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

Webagg backend: get rid of tornado#20591

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

Merged
tacaswell merged 6 commits intomatplotlib:mainfrommartinRenou:asyncio_timer
Oct 21, 2021

Conversation

@martinRenou
Copy link
Member

@martinRenoumartinRenou commentedJul 7, 2021
edited
Loading

PR Summary

This allows using the webagg backend in JupyterLite, by replacing tornado with asyncio. Seematplotlib/ipympl#334 andhttps://github.com/jtpio/jupyterlite/pull/219

cc.@davidbrochart

PR Checklist

  • Has pytest style unit tests (andpytest passes).
  • IsFlake 8 compliant (runflake8 on changed files to check).
  • New features are documented, with examples if plot related.
  • Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • Conforms to Matplotlib style conventions (installflake8-docstrings and runflake8 --docstring-convention=all).
  • [N/A] New features have an entry indoc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented indoc/api/next_api_changes/ (follow instructions in README.rst there).

stonebig reacted with thumbs up emojistonebig reacted with heart emoji
@jklymakjklymak added this to thev3.5.0 milestoneJul 7, 2021
@tacaswell
Copy link
Member

tacaswell commentedJul 8, 2021
edited
Loading

This seems like a major API change? We either need replacements/backcompat shims or a very clear API change note for the classes that no longer exist.

Does this put a floor on our tornado support to versions that know howto play nice with asyncio?

@martinRenou
Copy link
MemberAuthor

martinRenou commentedJul 9, 2021
edited
Loading

I guess we could keep the timertornado class around? And do a lazy import of tornado if one uses it.

This way the PR would just be about adding a new timer class that doesn't need tornado, and that ipympl could use.

@anntzer
Copy link
Contributor

I don't know enough about the ecosystem (whether the jupyter side or the async side :-)) to have an answer here, but do you think anyone is actually relying on the tornado timer? Could it be reasonably deprecated? Or perhaps more mildly, moved to backend_webagg, and make backend_webagg_core a "you need to provide your own timer" abstract backend?

@martinRenou
Copy link
MemberAuthor

Given the comments and concerns about backward compatibility, I've put back theTimerTornado.

Having theTimerTornado around is harmless in a "pyodide" context like JupyterLite as long as tornado is imported lazily, so we can definitely keep it.

stonebig and tacaswell reacted with heart emoji

@jklymakjklymak marked this pull request as draftJuly 21, 2021 01:41
@QuLogicQuLogic modified the milestones:v3.5.0,v3.6.0Aug 21, 2021
@stonebig
Copy link
Contributor

is there still hope on this for 3.5.0 ?

@tacaswell
Copy link
Member

@stonebig It looks like there are still a few back-compatibility changes that need to be addressed.

We have not "feature frozen" for 3.5 yet, can you give me a sense of how important / impactful getting this in would be?

@stonebig
Copy link
Contributor

For a windows user, Tornado is non-performant.
Martin writes this is also a stone to remove to improve wasm / web flight envelop of python Jupyter stack.

So my interest to push this, as I believe it will have positive effects for python on web and python on windows. Nothing more.

@tacaswell
Copy link
Member

This PR is affected by a re-writing of our history to remove a large number of accidentally committed filessee discourse for details.

To recover this PR it will need be rebased onto the new default branch (main). There are several ways to accomplish this, but we recommend (assuming that you call the matplotlib/matplotlib remote"upstream"

git remote updategit checkout maingit merge --ff-only upstream/maingit checkout YOUR_BRANCHgit rebase --onto=main upstream/old_master# git rebase -i main # if you prefergit push --force-with-lease# assuming you are tracking your branch

If you do not feel comfortable doing this or need any help please reach out to any of the Matplotlib developers. We can either help you with the process or do it for you.

Thank you for your contributions to Matplotlib and sorry for the inconvenience.

@tacaswelltacaswell marked this pull request as ready for reviewOctober 20, 2021 21:47
@tacaswelltacaswell modified the milestones:v3.6.0,v3.5.0Oct 20, 2021
tornado 5 is from ~2018 hence is consistent with our support window policy.
@tacaswelltacaswell merged commitcced93b intomatplotlib:mainOct 21, 2021
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestOct 21, 2021
tacaswell added a commit that referenced this pull requestOct 21, 2021
…591-on-v3.5.xBackport PR#20591 on branch v3.5.x (Webagg backend: get rid of tornado)
@ArchangeGabriel
Copy link
Contributor

I’m packaging matplotlib for ArchLinux and I have some questions regarding this changes:

  • the documentation (nor tests env, etc.) wasn’t updated and still says tornado is required for the webagg backend, is that correct?
  • if it’s not, in what cases is tornado still required?

@martinRenoumartinRenou deleted the asyncio_timer branchNovember 16, 2021 18:07
@martinRenou
Copy link
MemberAuthor

It is still needed, because the webagg backend provides aTornadoTimer class that might be used by dependencies (and by other places in Matplotlib?)

But in the long term the dependency might be removed?

Please someone correct me if I am wrong.

@tacaswell
Copy link
Member

The important change here is thatbackend_webagg_core no longer requires tornado. This is the module thatipympl imports and hence hiding the tornado import at that level removes an implicit tornado dependency from ipympl.

Howeverbackend_webagg.py still very much depends ontornado, the core application class is

classWebAggApplication(tornado.web.Application):
initialized=False
started=False
!

We may want to rename this asbackend_webagg_tornado and add abackend_webagg_fastapi,backend_webagg_aiohttp, (or maybe make those one ones sibling projects in mpl and also eject the tornado one?).

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tacaswelltacaswelltacaswell approved these changes

@QuLogicQuLogicQuLogic approved these changes

+1 more reviewer

@davidbrochartdavidbrochartdavidbrochart left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

@tacaswelltacaswell

Projects

None yet

Milestone

v3.5.0

Development

Successfully merging this pull request may close these issues.

8 participants

@martinRenou@tacaswell@anntzer@stonebig@ArchangeGabriel@QuLogic@davidbrochart@jklymak

[8]ページ先頭

©2009-2025 Movatter.jp