Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Cleanups to webagg & friends.#19127
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
38208bb
toffd9fa1
CompareFigureCanvasWebAgg and FigureCanvasNbAgg empty subclasses ofFigureCanvasWebAggCore. They only differed in that WebAggCore did notdefine the (common) timer class, which is easily fixed (but theTimerTornado definition needs to be moved above theFigureCanvasWegAggCore definition), and that WebAgg explicitly redefined`show` to use the module's `show`, whereas WebAggCore's `show` uses`pyplot.show`... but `pyplot.show` is defined as calling the backendmodule's `show`, so it comes down to the same.Still it's useful for them to be subclasses rather than straightaliases, to keep the possibility of a canvas->manager mapping.No need to explicitly mark WebAggCore as `supports_blit`, as that'sautodetected now (one can easily check that`FigureCanvasWebAggCore.supports_blit` is still True).Saving `pgf` to a BytesIO actually works fine nowadays, and can indeedby manually tested on WebAgg.
What is the test for this, since its largely untested by CI? |
anntzer commentedDec 16, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
test_backends_interactive.py::test_webagg should cover a good part of it? In fact looking athttps://codecov.io/gh/matplotlib/matplotlib/commit/25ee876375a1d98f9f925348a2578d40cc75cd0b the sole source of non-coverage is the fact that some of TimerTornado is untested, but I just shifted the whole implementation verbatim upwards in the source file... |
Uh oh!
There was an error while loading.Please reload this page.
FigureCanvasWebAgg and FigureCanvasNbAgg empty subclasses of
FigureCanvasWebAggCore. They only differed in that WebAggCore did not
define the (common) timer class, which is easily fixed (but the
TimerTornado definition needs to be moved above the
FigureCanvasWegAggCore definition), and that WebAgg explicitly redefined
show
to use the module'sshow
, whereas WebAggCore'sshow
usespyplot.show
... butpyplot.show
is defined as calling the backendmodule's
show
, so it comes down to the same.Still it's useful for them to be subclasses rather than straight
aliases, to keep the possibility of a canvas->manager mapping (#18854).
No need to explicitly mark WebAggCore as
supports_blit
, as that'sautodetected now (one can easily check that
FigureCanvasWebAggCore.supports_blit
is still True).Saving
pgf
to a BytesIO actually works fine nowadays, and can indeedby manually tested on WebAgg.
PR Summary
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).