Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replace getmask with getmaskarray#24118

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
oscargus wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromoscargus:getmaskarray

Conversation

oscargus
Copy link
Member

PR Summary

Related to#24115

There seems to be a change in numpy 1.24 where sometimesgetmask does not return an array. By usinggetmaskarray an 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

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (installflake8-docstrings and runflake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).

@oscargusoscargus marked this pull request as ready for reviewOctober 7, 2022 10:14
@oscargus
Copy link
MemberAuthor

Everything seems tested and passes.

@tacaswelltacaswell added this to thev3.7.0 milestoneOct 7, 2022
@tacaswell
Copy link
Member

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.

@tacaswell
Copy link
Member

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 ofFalse), then there is no need to pay the cost to expand that to an array of bools to pass it back into numpy.

I do think we should take the simplifications where we in-line thegetmask calls.

timhoffm reacted with thumbs up emoji

@oscargus
Copy link
MemberAuthor

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.

@oscargusoscargus marked this pull request as draftOctober 12, 2022 07:00
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
future releases
Development

Successfully merging this pull request may close these issues.

2 participants
@oscargus@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp