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
Bugfix for short version of np.nanmedian
#15228
Conversation
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
b3d16f7
to
ad70fe2
Compare
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.
@byrdie - thanks! But I fear it is not as simple. See inline comment...
@mhvk, do you think overriding |
@byrdie - I had to find some time to test, but this is odd: one should not be able to get a boolean array with units. But looking in more detail, I see that the problem is that somewhere along the line the quantity gets turned into Anyway, I think an override is appropriate here! |
e22b227
to
b8c57ea
Compare
The deadly bit if i understand correctly is in numpy |
@fdeugenio - unfortunately, getting masked quantities using Numpy itself fortunately does not use its masked class much, so there rarely is a problem. Sadly, |
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.
Looks great, only a minor note about the release note.
py39-test-image-mpl334-cov failure surely unrelated! |
…` for Numpy >= 1.25
b8c57ea
to
42d12de
Compare
Great, let's get this in. Thanks, @byrdie, and sorry it turned out to be a bit more involved than we thought at the start! |
…228-on-v5.3.x Backport PR #15228 on branch v5.3.x (Bugfix for short version of `np.nanmedian`)
numpy/numpy@6ac4d6d changed
numpy.lib.utils._median_nancheck()
to usenumpy.any()
which is not supported byastropy.units.Quantity
. This PR overridesnanmedian
to try and deal with this properly.Fixes #15225