[Numpy-discussion] feedback request: proposal to add masks to the core ndarray
Charles R Harris
Thu Jun 23 17:02:03 CDT 2011
On Thu, Jun 23, 2011 at 3:48 PM, Gael Varoquaux <
> On Thu, Jun 23, 2011 at 03:53:31PM -0500, Mark Wiebe wrote:
> > concluded that adding masks to the core ndarray appears is the best
> way to
> > deal with the problem in general.
> It seems to me that this is going to make the numpy array a way more
> complex object. Althought it is currently quite simple, that object has
> already a hard time getting acceptance beyond the scientific community,
> whereas it should really be used in many other places.
> Right now, the numpy array can be seen as an extension of the C array,
> basically a pointer, a data type, and a shape (and strides). This enables
> easy sharing with libraries that have not been written with numpy in
> The limitations of the subclassing approach that you mention do not seem
> fundemental to me. For instance the impossibility to mix subclasses could
> perhaps be solved using the Mixin Pattern.
Urghh. Um, excuse me.
> Ufuncs need work, but I have
> the impression that your proposal is simply to solve the special case of
> masked data in the ufunc by breaking the simple numpy array model.
I wonder how much of the complication could be located in the dtype.
> By moving in the core a growing amount of functionality, it seems to me
> that you are going to make it more and more complex while loosing its
> genericity. Each new feature will need to go in the core and induce a
> high cost. Making inheritance and unfuncs more generic seems to me like a
> better investment.
Inheritance is an overused idea, mostly because it is misused to provide
functionality. Mixins are another way to do the same but they have their own
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion