-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ENH: allow subclass overrides by removing explicit ndarray methods #4617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@mhvk Needs a rebase. |
@@ -205,7 +205,10 @@ now released for fancy indexing and ``np.where``. | |||
MaskedArray support for more complicated base classes | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
Built-in assumptions that the baseclass behaved like a plain array are being | |||
removed. In particalur, ``repr`` and ``str`` should now work more reliably. | |||
removed. In particalur, ``repr`` and ``str`` should now work more reliably, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a typo in "particalur"
85443c9
to
338d047
Compare
@charris - OK, rebased (and spelling error corrected). I thought this one was a pretty straightforward improvement. |
Are there any tests you could add to this that don't rely on the units package? This is a fairly substantial change, so it will be interesting to see if anything breaks. |
@mhvk I going to merge this, but it would still be good if you could add some tests. Maybe a sort of simplified units class? |
ENH: allow subclass overrides by removing explicit ndarray methods
This is a follow-on of #4586, and it removes all direct use of
ndarray
methods, changing, e.g.,ndarray.__iadd__(self._data, ...)
toself._data.__iadd__(...)
. The idea again is to not presume what data is being held (though it is not as essential to making maskedQuantity
work as is #4586).