Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix Wx inconsistencies#10518

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

Conversation

DietmarSchwertberger
Copy link
Contributor

PR Summary

From discussion at PR 10428:
The wx examples in master are currently not consistent with the recent changes around NavigationToolbar2.
This PR makes NavigationToolbar2 consistent through the three wx backends.
Examples are adjusted to be similar to the documentation example athttps://matplotlib.org/users/navigation_toolbar.html
The unused and undocumented classSubplotToolWX has been removed (Google did not find any code using this.)

PR Checklist

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

@@ -1474,25 +1474,6 @@ def updateButtonText(self, lst):
}


class SubplotToolWX(wx.Frame):
Copy link
Contributor

Choose a reason for hiding this comment

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

API changes (even for "apparently unused" stuff) should nearly always go through a deprecation period unless it's really too hard to keep around. Just decorate the class with@deprecated("2.2").

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Done

@@ -71,15 +71,8 @@ def blit(self, bbox=None):
filetypes = FigureCanvasAgg.filetypes


@cbook.deprecated("2.2")
Copy link
Contributor

Choose a reason for hiding this comment

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

Please leave until 3.0 (one minor-release deprecation period at least, usually two).

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I don't see that any other NavigationToolbar2 is deprecated, especially not the wx non-Agg one.
With the derived class removed and the modifiedimport NavigationToolbar2Wx as NavigationToolbar2WxAgg things are consistent again (no deprecation).

Not having the Toolbar alias in backend_wxagg can break things, though.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Having a deprecation for the Toolbar alias would require to replace the assignmentToolbar = NavigationToolbar2Wx with a derived and deprecated class. I would now be in favor of having this in wx and wxagg. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

derived deprecated class sounds good to me.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Thanks. Done, incl. alternatives in deprecation messages.

from .backend_wx import(
_BackendWx, _FigureCanvasWxBase, FigureFrameWx, NavigationToolbar2Wx)
from .backend_wx import_BackendWx, _FigureCanvasWxBase, FigureFrameWx
from .backend_wx import NavigationToolbar2Wx as NavigationToolbar2WxCairo
Copy link
Contributor

Choose a reason for hiding this comment

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

can go in the previous line (would prefer this) as

from .backend_wx import (    _BackendWx, _FigureCanvasWxBase, FigureFrameWx,    NavigationToolbar2Wx as NavigationToolbar2WxCairo)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Done, also for wxagg.

@DietmarSchwertbergerDietmarSchwertberger added this to thev2.2.0 milestoneFeb 20, 2018
@DietmarSchwertbergerDietmarSchwertberger added the Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labelFeb 20, 2018
@DietmarSchwertberger
Copy link
ContributorAuthor

"Release critical" together with PR#10428, to have working wx backends.

@DietmarSchwertbergerDietmarSchwertberger merged commitbd015d0 intomatplotlib:masterFeb 24, 2018
@DietmarSchwertbergerDietmarSchwertberger deleted the wx-inconsistencies branchFebruary 24, 2018 14:13
lumberbot-appbot pushed a commit that referenced this pull requestFeb 24, 2018
dstansby added a commit that referenced this pull requestFeb 24, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer approved these changes

Assignees
No one assigned
Labels
GUI: wxRelease criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Milestone
v2.2.0
Development

Successfully merging this pull request may close these issues.

2 participants
@DietmarSchwertberger@anntzer

[8]ページ先頭

©2009-2025 Movatter.jp