Skip to content

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

Merged
merged 1 commit into from
Jun 15, 2015

Conversation

mhvk
Copy link
Contributor

@mhvk mhvk commented Apr 12, 2014

This is a follow-on of #4586, and it removes all direct use of ndarray methods, changing, e.g.,
ndarray.__iadd__(self._data, ...) to self._data.__iadd__(...). The idea again is to not presume what data is being held (though it is not as essential to making masked Quantity work as is #4586).

@charris
Copy link
Member

charris commented Jun 9, 2015

@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,
Copy link
Contributor

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"

@mhvk mhvk force-pushed the ma/no-direct-ndarray-methods branch from 85443c9 to 338d047 Compare June 11, 2015 00:13
@mhvk
Copy link
Contributor Author

mhvk commented Jun 11, 2015

@charris - OK, rebased (and spelling error corrected). I thought this one was a pretty straightforward improvement.

@charris
Copy link
Member

charris commented Jun 11, 2015

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.

@charris
Copy link
Member

charris commented Jun 15, 2015

@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?

charris added a commit that referenced this pull request Jun 15, 2015
ENH: allow subclass overrides by removing explicit ndarray methods
@charris charris merged commit 7e04882 into numpy:master Jun 15, 2015
@mhvk mhvk deleted the ma/no-direct-ndarray-methods branch February 19, 2017 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants