-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
BUG: Fix fill value in masked array '==' and '!=' ops. #12257
Conversation
The type of the fill_value needs to be `bool_` in order to match the result type of `==` and `!=`. Closes numpy#12248.
Would it make sense for |
@eric-wieser That's a whole other topic which affects other binary operators. Currently, IIRC, the fill value for other binary operators is taken from the first argument if not None, otherwise from of the second, which I suppose we could extend to the |
@eric-wieser I'm actually not convinced that instances of masked arrays really need a fill value, seems more like something that should be put in at the function call level. |
Cover the string and numeric types. Structured types were already covered.
105b1e8
to
173f65c
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.
I just wanted to confirm that this fixes the issues we were seeing in astropy - thanks @charris!
The rationale would be that |
Does this manifest itself for non-structured arrays? From the test, it seems you only test structured ones |
?. I only added tests for non-structured dtypes. There were some previous tests for structured dtypes.
Still don't see the use, as |
@charris - just to check, do you have an ETA for the 1.15.4 release? We're going to do a major Astropy release shortly (within <1 week) so we're trying to figure out whether we should add workarounds to Astropy (but we won't if 1.15.4 is out first). Thanks! |
@astrofrog I was just thinking about that. Normally, I'd make it about the 20'th, but given that 1.15 is at end of releases and pretty much only needs this fix, I was thinking maybe this next weekend. I'd be happy to coordinate the release with astropy. |
@charris - this next weekend would be perfect and in time for the astropy release, if you are able to do that. We'll be issuing a release candidate this week and the final release next week - and this is the one for which we'll need to make sure numpy 1.15.4 is release to avoid users running into issues. Thanks! |
OK, will do. |
The type of the fill_value needs to be
bool_
in order to matchthe result type of
==
and!=
.Closes #12248.