Skip to content

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

Merged
timhoffm merged 1 commit into
matplotlib:masterfrom
dstansby:patch-contains
Apr 22, 2019
Merged

Fix patch contains logic for patches that don't have any codes#13998
timhoffm merged 1 commit into
matplotlib:masterfrom
dstansby:patch-contains

Conversation

@dstansby
Copy link
Copy Markdown
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
Copy Markdown
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