Skip to content
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

MAINT: let average preserve subclass information. #8290

Merged
merged 1 commit into from
Nov 19, 2016

Conversation

mhvk
Copy link
Contributor

@mhvk mhvk commented Nov 18, 2016

This behaviour matches that for most other numpy functions (such as np.mean). It was initially slated for 1.12 (#7382), but replaced by a FutureWarning (#7433). Hence, this is for 1.13.

For ndarray subclasses, ``numpy.average`` will now return an instance of the
subclass, matching the behavior of most other numpy functions such as ``mean``.
As a consequence, also calls that returned a scalar may now return a subclass
array scalar.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add something under Compatibility notes? If you look In the 1.12 notes there is a subsection FutureWarning to changed behavior that has a list of changes.

@charris
Copy link
Member

charris commented Nov 19, 2016

LGTM modulo release note. One release would normally be a bit short, but this looks almost like a bug fix to me.

This behaviour matches that for most other numpy functions (such as
np.mean).  It was initially slated for 1.12, but replaced by a
FutureWarning.  Hence, this is for 1.13.
@mhvk mhvk force-pushed the average-preserve-subclasses branch from 99cbb78 to 3f3d205 Compare November 19, 2016 17:50
@mhvk
Copy link
Contributor Author

mhvk commented Nov 19, 2016

OK, I added the additional entry. I kept the original one in the API change section; that is what you meant, correct?

As for the short warning period, I think that should be fine, given that we felt it was almost OK to just add to 1.12 (and it does feel more like an oversight/bug than anything else).

@charris
Copy link
Member

charris commented Nov 19, 2016

Thanks @mhvk. I'll shorten the list entry later on, but yes, that is what I had in mind.

@charris charris merged commit a913097 into numpy:master Nov 19, 2016
@mhvk mhvk deleted the average-preserve-subclasses branch November 19, 2016 19:37
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.

None yet

2 participants