Skip to content

Go back to checking figures for their manager in destroy. #18184

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 2 commits into from
Aug 11, 2020

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 5, 2020

PR Summary

This is a partial revert of a small part of #13581.

Fixes #18163.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • [n/a] New features are documented, with examples if plot related
  • [n/a] Documentation is sphinx and numpydoc compliant
  • [n/a] Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • [n/a] Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way

@QuLogic QuLogic added this to the v3.3.1 milestone Aug 5, 2020
num = next((manager.num for manager in cls.figs.values()
if manager.canvas.figure == fig), None)
if num is not None:
cls.destroy(num)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment, why we have to destroy by number?

Copy link
Member Author

@QuLogic QuLogic Aug 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually works either way (manager or manager.num); it's just that the code in destroy is simpler for num, i.e., we know that cls.figs.get(manager.num) is manager because we just pulled manager from cls.figs.

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Travis OSX fails. I'm unclear if the error is related to the PR.

@QuLogic
Copy link
Member Author

QuLogic commented Aug 5, 2020

Yea, that's weird, a restart was not effective; I'll try it out on the mac.

@QuLogic
Copy link
Member Author

QuLogic commented Aug 6, 2020

It worked on the Mac Mini, so I restarted Travis again.

@QuLogic QuLogic force-pushed the revert-canvas-manager-destroy branch 2 times, most recently from 4d8e0d1 to f65eb17 Compare August 6, 2020 03:47
@QuLogic
Copy link
Member Author

QuLogic commented Aug 6, 2020

I tried increasing the timeout, which didn't work, but it's appearing on other tests now, so I've reverted that as the problem doesn't seem strictly related to this PR.

@tacaswell
Copy link
Member

As discussed on the call to get 3.3.1 out the door we are going to disable this test on travis (it should be noted that we do run this test on azure) so the current working theory is that this is a travis-specific issues with the GUI and is not worth the time right now to track down the root problem (but we should open a new issue and label it "good first issue / medium" localized, but involves defeating CI ;) ).

@QuLogic QuLogic force-pushed the revert-canvas-manager-destroy branch from f65eb17 to db6fb4d Compare August 10, 2020 20:37
@jklymak jklymak merged commit 5426474 into matplotlib:master Aug 11, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 11, 2020
@QuLogic QuLogic deleted the revert-canvas-manager-destroy branch August 11, 2020 02:56
QuLogic added a commit that referenced this pull request Aug 11, 2020
…184-on-v3.3.x

Backport PR #18184 on branch v3.3.x (Go back to checking figures for their manager in destroy.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Figure cannot be closed if it has associated Agg canvas
4 participants