Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Changed hatch density typing to float. Added FutureWarning for cases …#27032
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
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Not sure I fully understood the transition path, but I think that the default value should not be changed to a float at this stage as that will trigger warnings for the default which is a bit confusing (and leads to errors). Probably, the way is to type it as both int and float for now and keep the int default? |
…where conversion would change behaviour
Thanks for the feedback! matplotlib/lib/matplotlib/tests/test_path.py Lines 544 to 548 inf068c37
And the second one, passes a float and shouldn get a warning (could be any float 2.0~2.5) matplotlib/lib/matplotlib/tests/test_path.py Lines 550 to 551 inf068c37
Is that what you meant? |
I think the check as implemented will not warn for floating inputs that are integers as That said, i'm unclear why additional casts were added here, as they seem a) likely to be unintentionally missed when doing the behavior change (a comment would help that point) and b) likely to cause inputs that wewant to warn tonot warn. I think that the cast to int should be retained in That said, there may be some patterns (such as circles/stars/etc) thatare required to be integers, so maybe we should think about what the code looks like after expiry here... there may be some that can be continuously changed (lines feels like they should be able to) and some that are necessarily discrete (circles, maybe). I'm going to play around with the density uncast and see what breaks. |
Uh oh!
There was an error while loading.Please reload this page.
…where conversion would change behaviour
PR summary
Relates to#26645 . The test for the FutureWarning is added in test_path.py ( there is no test_hatch.py). All signatures were changed to float, also the defaults converted from 6 to 6.0.
PR checklist