Re: [Numpy-discussion] question about ufuncs

2009-02-06 Thread Darren Dale
On Sun, Feb 1, 2009 at 7:39 PM, Darren Dale dsdal...@gmail.com wrote: On Sun, Feb 1, 2009 at 7:33 PM, Pierre GM pgmdevl...@gmail.com wrote: On Feb 1, 2009, at 6:32 PM, Darren Dale wrote: Is there an analog to __array_wrap__ for preprocessing arrays on their way *into* a ufunc? For

Re: [Numpy-discussion] question about ufuncs

2009-02-06 Thread Pierre GM
On Feb 6, 2009, at 4:25 PM, Darren Dale wrote: I've been looking at how ma implements things like multiply() and MaskedArray.__mul__. I'm surprised that MaskedArray.__mul__ actually calls ma.multiply() rather than calling super(MaskedArray,self).__mul__(). There's some under-the-hood

Re: [Numpy-discussion] question about ufuncs

2009-02-06 Thread Darren Dale
On Fri, Feb 6, 2009 at 5:18 PM, Pierre GM pgmdevl...@gmail.com wrote: On Feb 6, 2009, at 4:25 PM, Darren Dale wrote: I've been looking at how ma implements things like multiply() and MaskedArray.__mul__. I'm surprised that MaskedArray.__mul__ actually calls ma.multiply() rather than

Re: [Numpy-discussion] question about ufuncs

2009-02-06 Thread Darren Dale
On Fri, Feb 6, 2009 at 6:11 PM, Darren Dale dsdal...@gmail.com wrote: On Fri, Feb 6, 2009 at 5:18 PM, Pierre GM pgmdevl...@gmail.com wrote: On Feb 6, 2009, at 4:25 PM, Darren Dale wrote: I've been looking at how ma implements things like multiply() and MaskedArray.__mul__. I'm

Re: [Numpy-discussion] question about ufuncs

2009-02-01 Thread Pierre GM
On Feb 1, 2009, at 6:32 PM, Darren Dale wrote: Is there an analog to __array_wrap__ for preprocessing arrays on their way *into* a ufunc? For example, it would be nice if one could do something like: numpy.sin([1,2,3]*arcseconds) where we have the opportunity to inspect the context,

Re: [Numpy-discussion] question about ufuncs

2009-02-01 Thread Darren Dale
On Sun, Feb 1, 2009 at 7:33 PM, Pierre GM pgmdevl...@gmail.com wrote: On Feb 1, 2009, at 6:32 PM, Darren Dale wrote: Is there an analog to __array_wrap__ for preprocessing arrays on their way *into* a ufunc? For example, it would be nice if one could do something like: