MAINT: FutureWarning for changes to np.average subclass handling#7433
MAINT: FutureWarning for changes to np.average subclass handling#7433charris merged 1 commit intonumpy:masterfrom
Conversation
numpy/lib/function_base.py
Outdated
There was a problem hiding this comment.
If doing this, should add comment with data and release to help track when to change. Something like
# 3/19/2016 1.12.0
|
Also add something to the release notes. The 1.11.0 notes have a |
numpy/lib/function_base.py
Outdated
There was a problem hiding this comment.
Since I hope to change this everywhere else as well by 1.12 (and probably force it in the numpy code base for the most part), could you add a stacklevel=2?
0105073 to
6b0301e
Compare
|
Updated |
|
☔ The latest upstream changes (presumably #7437) made this pull request unmergeable. Please resolve the merge conflicts. |
|
I am not sure what is the status of this now that #7406 has been merged. It if is still needed it needs a rebase on master and there is a behaior -> behavior typo to fix (missing v). EDIT: in two places. |
|
@ahaldane What is the status of this? Note also the previous comment. Looks straight forward to me. |
|
Yeah, looks like we should do this. I'll fix it up tonight probably. |
6b0301e to
5917372
Compare
|
Thanks Allan. |
|
Just a reminder that for 1.12.0 the behaviour was supposed to be changed to allow subclasses in |
This slightly rolls back the changes to np.average in #7382, so that we emit a
FutureWarningifnp.averageis called on anndarraysubclass. In the future,np.averagewill preserve subclasses, just likenp.meanand almost all other numpy methods.This is to fix #7403. Note that the specific case in #7403 will probably also be fixed by #7406, but this PR should make sure we aren't more generally breaking anyone's code (for now).