Replace getmask with getmaskarray#24118
Conversation
|
Everything seems tested and passes. |
|
I propose we merge this to main. If we have more issues with masked arrays and new numpy we have this in our backpocket to backport if needed but we do not put speculative changes on the bug-fix branch. |
|
I am weakly against merging this. In all of these cases we are grabbing the mask, but then passing it straight back into numpy. If there is no mask (which numpy internally stores as numpy's version of I do think we should take the simplifications where we in-line the |
|
Sure, we can just let it hang around and see if anything shows up. I realize that the case which broke is quite different from these, so it may very well be that it is OK to pass a scalar mask here. I'll try to remind myself of it when 3.7 is closing in and create a PR with the inlining if not merged by then. |
PR Summary
Related to #24115
There seems to be a change in numpy 1.24 where sometimes
getmaskdoes not return an array. By usinggetmaskarrayan array is guaranteed to be returned.This PR is a bit speculative. It should not break anything, but may not really help as it may be that this change is never triggered (with current test data). On the other hand, it may help for certain input data (not clear which).
Will be interesting to see test coverage for the changes as experience shows that not all the masked stuff is tested everyhwhere.
PR Checklist
Tests and Styling
pytestpasses).flake8-docstringsand runflake8 --docstring-convention=all).Documentation
doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).