Skip to content

Various backend cleanups. - #15211

Merged
QuLogic merged 1 commit into
matplotlib:masterfrom
anntzer:backends_cleanups
Mar 14, 2020
Merged

QuLogic merged 1 commit into
matplotlib:masterfrom
anntzer:backends_cleanups

Conversation

@anntzer

@anntzer anntzer commented Sep 7, 2019

Copy link
Copy Markdown
Contributor
  • 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


class FigureManagerPgf(FigureManagerBase):
pass
FigureManagerPgf = FigureManagerBase

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
anntzer force-pushed the backends_cleanups branch from a7223c8 to 4a9f6a8 Compare March 14, 2020 12:17
@anntzer

anntzer commented Mar 14, 2020

Copy link
Copy Markdown
Contributor Author

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.

3 participants