-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: Define <
, <=
, >
, >=
for masked arrays
#21812
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
Conversation
Arg, no... this should not really be necessary, closing for now. |
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 good! I agree with the actual underlying data values just being the result of the comparison.
Oops, I hadn't seen you closed it! Why would this not be necessary? It is true that in principle this could be done inside |
Yeah, I will reopen (and remove the release notes, I don't think they are actually necessary). |
This defines the comparison operators (other than `==` and `!=`) explicitly for masked arrays. The mask is ignored for the resuling `res._data` (unlike `==` and `!=` which take the mask into account. Closes numpygh-21770, although the way that masked arrays propagate the fill-value seems generally broken and error prone.
I guess my point was that the fill-value propagation seems broken for all ufuncs at least when the result dtype does not match the (first) input. The best solution is probably indeed EDIT: Maybe unclear... This is sufficient to fix all the issues. However, if ufuncs were not broken, this should not be necessary. For one, it leaves |
Yes, agreed that fill-value propagation is broken/tricky. But separate from this PR at least. |
<
, <=
, >
, >=
for masked arrays<
, <=
, >
, >=
for masked arrays
@seberg Are you happy with this? |
Yes, happy enough andnd it should fix (most) of astropy's current issue. We still need to figure out if there is something to do about gh-21784 or not (but it is distinct). |
Thanks Sebastian. |
This defines the comparison operators (other than
==
and!=
)explicitly for masked arrays.
The mask is ignored for the resuling
res._data
(unlike==
and!=
which take the mask into account.Closes gh-21770, although the way that masked arrays propagate the
fill-value seems generally broken and error prone.