Re: [Numpy-discussion] Inheriting from ndarray Was: deprecate numpy.matrix

2014-02-11 Thread Todd
On Feb 11, 2014 5:01 AM, Alexander Belopolsky ndar...@mac.com wrote:


 On Mon, Feb 10, 2014 at 11:31 AM, Nathaniel Smith n...@pobox.com wrote:

 And in the long run, I
 think the goal is to move people away from inheriting from np.ndarray.


 This is music to my ears,

There are a lot of units (meter, foot, built, etc.) packages that use
inheriting from numpy to handle their units.  I wouldn't call it a
shortcut, it is a common design decision.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


[Numpy-discussion] Inheriting from ndarray Was: deprecate numpy.matrix

2014-02-10 Thread Alexander Belopolsky
On Mon, Feb 10, 2014 at 11:31 AM, Nathaniel Smith n...@pobox.com wrote:

 And in the long run, I
 think the goal is to move people away from inheriting from np.ndarray.


This is music to my ears, but what is the future of numpy.ma?  I understand
that numpy.oldnumeric.ma (the older version written without inheritance)
has been deprecated and slated to be removed in 1.9.  I also have seen some
attempts to bring ma functionality into the core ndarray object, but those
have not been successful as far as I can tell.

In general, what is the future of inheriting from np.ndarray?
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion


Re: [Numpy-discussion] Inheriting from ndarray Was: deprecate numpy.matrix

2014-02-10 Thread Charles R Harris
On Mon, Feb 10, 2014 at 9:01 PM, Alexander Belopolsky ndar...@mac.comwrote:


 On Mon, Feb 10, 2014 at 11:31 AM, Nathaniel Smith n...@pobox.com wrote:

 And in the long run, I
 think the goal is to move people away from inheriting from np.ndarray.


 This is music to my ears, but what is the future of numpy.ma?  I
 understand that numpy.oldnumeric.ma (the older version written without
 inheritance) has been deprecated and slated to be removed in 1.9.  I also
 have seen some attempts to bring ma functionality into the core ndarray
 object, but those have not been successful as far as I can tell.


numpy.ma is pretty much unmaintained at the moment, but it is pretty stable
and there are no plans to remove it. I'm kinda sad that moving the
functionality into numpy came to naught, but the time was short and the
disagreements were long. Hopefully we learned something in the attempt. I
don't know of any plans for masked arrays at the moment apart for waiting
to see what happens with dynd. I don't know what the chances of an overhaul
might be, or even if it could be made without disturbing current code. I
think we would have to offer something special to motivate folks to even
think of switching.



 In general, what is the future of inheriting from np.ndarray?


Well, we can't do much about it except discourage it. It is often a bad
design decision that people get sucked into because they want to borrow
some functionality. OTOH, there hasn't been an easy way to make use of
ndarray functionality for non-subclasses, and there is a *lot* to implement
to make an ndarray like object. Hopefully the new `__numpy_ufunc__`
attribute will make that easier.

If you have suggestions we'd like to hear them.

Chuck
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion