-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ENH: Set mask=None equivalent to mask=False in np.ma.array() #17212
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
Thanks for the contribution. As I commented in the issue, I don't think this is worth optimizing for. Let's see if anyone else has an opinion in the issue discussion, and if not I'd be inclined to just close both. |
The code seems strange in that In that case, I think I with Eric here, if all we are saving is that the result has an array as a mask instead of |
@seberg, |
Oops, ok, so this ends up using the |
If nothing else, avoiding this patch means that performance users who care about performance are forced to write |
I actually added the shortcut for So again, if |
Well, I agree with you that there is no point in propping users towards the better version by keeping one version slow... I would see two reasons to not do this:
neither probably apply here, so I am OK with doing this. But I do think it is at the wrong place right now. It should be part of the later fast-path. (It also is a bit annoying that half the reason why we have a fast path, is probably that the normal path is so strange, and likely unnecessary slow due to that). |
Right, I'm sure we could speed up the normal path here, which would also speed up:
which just like |
It appears that this PR was incorrectly closed by github while renaming the NumPy main (previously master) branch. I suspect because the original repository was also deleted. That seems like a github issue, but I am not sure there is a solution to it aside from opening a new PR. Sorry about that issue, I did not review the PR. However, even if the local branches were deleted, it seems the work is still available (e.g. using |
Linked Issue: #17046
A minor change in np.ma.array().
Didn't explicitly document or added tests for this change(since it is minor) but suggestions are welcome.