-
Couldn't load subscription status.
- Fork 297
Don't remove mask on no-mask masked arrays #2856
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
|
Surprised this behaviour isn't tested... |
|
Relates to #2046. |
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.
@djkirkham these changes definitely need some testing associated with them...
Thanks for taking this on though!
| result = scipy.stats.mstats.mquantiles(data, quantiles, axis=-1, | ||
| **kwargs) | ||
| if not ma.isMaskedArray(data) and not ma.is_masked(result): | ||
| result = np.asarray(result) |
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've reinstated this check since the cube is constructed in this method, and the guard only causes it to be unmasked if the input data was not a masked array, which seems sensible.
| fullcube_data[slice_indices_tuple] = data | ||
|
|
||
| # Remove the data mask if completely unused. | ||
| if not np.ma.is_masked(fullcube_data): |
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.
This array is constructed as a masked array at line 223, so if we don't convert it to an ndarray it will output a masked array even if the input is an ndarray.
|
I've reinstated some of the checks I removed. See my comments on commit f63d950 |
|
LGTM. I'll cross-check the behaviour and ensure there is an appropriate what's new entry. |
|
Just to confirm that as a result of this PR, the behaviour is unchanged between iris 1.13 and 2.0. Code to confirm: |
Replaces #1575
Removes all instances of checking if a MaskedArray has no mask and replacing it with an ndarray.