Skip to content
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

Various backend cleanups. #15211

Merged
merged 1 commit into from
Mar 14, 2020
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 7, 2019

  • Noninteractive backends don't need to redefine draw() as a
    do-nothing: that's already the default in the base class.
  • FigureCanvasQT doesn't need to assign self.figure = figure:
    that's already done in the super() init.
  • Use star-unpack in backend_template.
  • The list of event handlers set up by backend_wx is much bigger than
    previously documented.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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

@@ -963,14 +963,12 @@ def get_renderer(self):
return RendererPgf(self.figure, None, dummy=True)


class FigureManagerPgf(FigureManagerBase):
pass
FigureManagerPgf = FigureManagerBase
Copy link
Member

Choose a reason for hiding this comment

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

I wouldn't do this because you don't create a FigureManagerPgf type with that, so that

>>> mgr = FigureManagerPgf()
>>> type(mgr)
<class 'FigureManagerBase'>

which is a bit confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is consistent with FigureManagerPS, FigureManagerPDF and FigureManagerSVG, and was discussed in #9551 (review).

Copy link
Member

Choose a reason for hiding this comment

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

Still not convinced this is a good approach, but accepting as precedenced.

- Noninteractive backends don't need to redefine `draw()` as a
  do-nothing: that's already the default in the base class.
- The pgf backend manager can just be an alias for FigureManagerBase:
  this is consistent with the other noninteractive backends.
- FigureCanvasQT doesn't need to assign `self.figure = figure`:
  that's already done in the super() init.
- Use star-unpack in backend_template.
- The list of event handlers set up by backend_wx is much bigger than
  previously documented.
@anntzer
Copy link
Contributor Author

anntzer commented Mar 14, 2020

rebased

@QuLogic QuLogic merged commit eba349a into matplotlib:master Mar 14, 2020
@QuLogic QuLogic added this to the v3.3.0 milestone Mar 14, 2020
@anntzer anntzer deleted the backends_cleanups branch March 14, 2020 19:33
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.

None yet

3 participants