Skip to content

BUG: Fix masked median bug #21999

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 4 commits into from
Jul 17, 2022
Merged

BUG: Fix masked median bug #21999

merged 4 commits into from
Jul 17, 2022

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Jul 16, 2022

This is the rebased and followed-up version of #10909

closes #10757

jsclose and others added 4 commits July 16, 2022 15:42
Fixed issue that occurs when trying to take the median of a list of masked arrays.
Added a check to see if the input is a list then converts to a masked array.
See issue numpy#10757 for more information.
Copy link
Contributor

@rossbar rossbar left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @bsipocz & @jsclose !

@rossbar rossbar merged commit 6b8d55e into numpy:main Jul 17, 2022
@pllim
Copy link
Contributor

pllim commented Jul 18, 2022

I started seeing AttributeError: 'MaskedArray' object has no attribute 'info' in astropy devdeps job. I wonder if it is related to this or something else. The "nightly wheel" was uploaded "8 hours and 24 minutes ago" according to https://anaconda.org/scipy-wheels-nightly/numpy so it is plausible that this patch was included.

Example log: https://github.com/astropy/astropy/runs/7383859498?check_suite_focus=true

Update: I restarted a previously passing job on main and it fails now with the same errors. See https://github.com/astropy/astropy/runs/7390810435?check_suite_focus=true

(I will cross-link astropy issue here when I create one.)

@seberg
Copy link
Member

seberg commented Jul 18, 2022

@pllim I would suspect gh-21977 although there was already one fixup to that, I would not be surprised if that PR needs a few more fixups before the end. (I really like the fact that it uses __array_ufunc__ now, but I am not sure how tricky it is and did not take a super close look at it myself yet.)

@pllim
Copy link
Contributor

pllim commented Jul 18, 2022

Thanks for pointing me to that other PR and sorry for the noise here!

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.

Taking median (np.ma.median) of a list of masked arrays.
5 participants