Skip to content

Fix pickling of AxesWidgets. #28430

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 5 commits into from
Jul 4, 2024
Merged

Fix pickling of AxesWidgets. #28430

merged 5 commits into from
Jul 4, 2024

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jun 20, 2024

There's no need to hold onto the (non-picklable) canvas as an attribute.

Closes #22482.

PR summary

PR checklist

@anntzer anntzer added topic: widgets/UI topic: pickle Issues to do with pickling labels Jun 20, 2024
@QuLogic QuLogic added this to the v3.9.1 milestone Jun 26, 2024
ksunden
ksunden previously approved these changes Jun 26, 2024
@ksunden ksunden dismissed their stale review June 26, 2024 19:45

SpanSelector sets the canvas attrubute in __init__, which fails because it is readonly now

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

This apparently breaks SpanSelector.

@tacaswell
Copy link
Member

This is also going to break _changed_canvas which we use to suppress events durring saving (see #25085 / 6bb208d )

@anntzer anntzer force-pushed the pw branch 2 times, most recently from 31be678 to f13e212 Compare June 26, 2024 22:00
There's no need to hold onto the (non-picklable) canvas as an attribute.
@anntzer
Copy link
Contributor Author

anntzer commented Jun 27, 2024

Now fixed; the test failure is unrelated.

@ksunden
Copy link
Member

ksunden commented Jun 27, 2024

Test failure is not unrelated, it is the newly added test

Copy link
Member

@ksunden ksunden left a comment

Choose a reason for hiding this comment

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

Anyone can merge on CI finishing

@QuLogic QuLogic merged commit aad2a58 into matplotlib:main Jul 4, 2024
44 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 4, 2024
@anntzer anntzer deleted the pw branch July 4, 2024 00:20
QuLogic added a commit that referenced this pull request Jul 4, 2024
…430-on-v3.9.x

Backport PR #28430 on branch v3.9.x (Fix pickling of AxesWidgets.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: pickle Issues to do with pickling topic: widgets/UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ENH]: pickle (or save) matplotlib figure with insteractive slider
4 participants