[Numpy-discussion] core library structure
Fri Feb 4 13:46:01 CST 2011
On Fri, Feb 4, 2011 at 2:23 PM, Lluís <firstname.lastname@example.org> wrote:
> Darren Dale writes:
>> With generic functions, you wouldn't have to remember to use the ufunc
>> provided by masked array for one type, or the default numpy for
>> another type.
> Sorry, but I don't see how generic functions should be a better approach
> compared to redefining methods on masked_array . In both cases you
> have to define them one-by-one.
>  assuming 'np.foo' and 'ma.foo' (which would now be obsolete) simply
> call 'instance.foo', which in the ndarray level is the 'foo' ufunc
That's a bad assumption. np.ndarray.__add__ actually calls the np.add
ufunc, not the other way around. For example, np.arcsin is a ufunc
that operates on ndarray, yet there is no ndarray.arcsin method.
More information about the NumPy-Discussion