8000 Fix patch contains logic for patches that don't have any codes by dstansby · Pull Request #13998 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix patch contains logic for patches that don't have any codes #13998

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

Merged
merged 1 commit into from
Apr 22, 2019

Conversation

dstansby
Copy link
Member

#10776 changed the logic inside Patch.contains(), and in particular includes the line

codes = self.get_path().codes

If this evaluates to None, then the proceeding logic doesn't work and raises an error. This has broken scrolling/zooming plots made with custom projections in Astropy (astropy/astropy#8545). I presume this is because there is a custom Patch somewhere along the line who's path doesn't contain any codes.

This fix just checks if self.get_path().codes == None, and if it is applies the old logic that was used before #10776 - not sure if this is the long term fix, but in the short term it should be fine.

@dstansby dstansby added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Apr 21, 2019
@dstansby dstansby added this to the v3.1.0 milestone Apr 21, 2019
@tacaswell
Copy link
Member

Thanks for tracking this down!

In the future, if we break down-stream packages, I think the bug-reports should come to us first (or at least concurrently) as we should not be breaking down-stream packages!

@timhoffm timhoffm merged commit 1956b1d into matplotlib:master Apr 22, 2019
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 22, 2019
jklymak added a commit that referenced this pull request Apr 22, 2019
…998-on-v3.1.x

Backport PR #13998 on branch v3.1.x (Fix patch contains logic for patches that don't have any codes)
@dstansby dstansby deleted the patch-contains branch April 23, 2019 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0