Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
fix bug where make_compound_path kept all STOPs#16822
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
lib/matplotlib/path.py Outdated
| codes[i:i+len(path.codes)]=path.codes | ||
| i+=len(path.vertices) | ||
| # remove internal STOP's, replace kinal stop if present |
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.
typo: final
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 would also not bother with restoring the final STOP given that it doesn't matter and we may deprecate STOPs.
And even though this is clearly a bugfix, it also changes the behavior of the function wrt STOP codes, so it may change it a tiny bit more (in a less observable fashion! the final STOP doesn't matter, unlike the middle ones) to keep the implementation simpler.
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.
If that is acceptable, then I will document it and go with ignoring all STOPs.
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.
at least for me, it seems ok.
Uh oh!
There was an error while loading.Please reload this page.
tacaswell commentedMar 18, 2020
I am concerned about deprecating a path code given how far down the stack this is. Would it be simpler to replace the STOP with MOVETO in the concatenated codes? |
tacaswell commentedMar 18, 2020
Notionally 👍 to this change, concerned about deprecating STOP, holding off on approving given there are 3 proposed implementations ;) |
anntzer commentedMar 18, 2020
this is still not deprecating STOP, just changing the behavior of make_compound_path. |
Uh oh!
There was an error while loading.Please reload this page.
brunobeltran commentedMar 18, 2020
brunobeltran commentedMar 18, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I will also point out here for the record that the "truly correct" behavior is something like but making this solution actually work adds a disproportionate amount of code complexity for a corner case (concatenating multiple paths with internal STOPs) that it's not clear we need to support (whereas concatenating a bunch of paths that correctly end in stop should surely work correctly). |
Uh oh!
There was an error while loading.Please reload this page.
aecfef3 to2f72135Compare2f72135 to95b33b1Comparebrunobeltran commentedMar 18, 2020
Sorry for force-push. Accidentally pull'd in from master, had to rebase to trigger CI to finish running. |
timhoffm commentedMar 18, 2020
Force-pushing to your own PR branch is perfectly fine. |
anntzer left a comment
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.
anyone can merge postci.
timhoffm commentedMar 19, 2020
Thanks@brunobeltran! |
PR Summary
Fixes underlying issue in
make_compound_paththat would keep.Path.cleanedfrom being a drop-in replacement forbezier.make_path_regular(#14199).A path we create by concatenating many paths should never have internal STOPs, as STOP is documented to mark the end of theentire path.
Long term solution is probably to deprecate
Path.STOP, but then this code can be easily deleted as it is self-contained, and the new test will signal.PR Checklist