-
Notifications
You must be signed in to change notification settings - Fork 10
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
Proposal: Transition matplotlib-pyodide to Maintenance-Only Mode #65
Comments
Thanks for opening this proposal! I've pinned the issue for higher visibility and to invite more comments by users. A few points from my side:
and perhaps a naïve question:
|
That's correct.
matplotlib_inline backend is default for jupyterlite.
I am not sure to be honest. If people download matplotlib-pyodide from PyPI, we could find some PyPI download stats, but it is not available for us. |
From JsDelivr it looks like matplotlib_pyodide gets about 50,000 downloads per week. |
We set |
Maybe we could start by removing the dependency? |
Sounds fine to me. It would be a breaking change, but I think it worth to do so. |
I think I may be able to help here. There is an existing backend in Matplotlib called WebAgg that serves Matplotlib figures using Normally I would do some preliminary work to see how feasible this sort of thing is before sticking my neck out, but I realise that you are close to giving up on this so time is of the essence! Assuming it is feasible and that you happy to eventually drop two backends in this repo, a possible work sequence could be:
I've joined the pyodide Discord in case that helps. Oh, who am I? I'm a Matplotlib maintainer and my day job is mostly working on JupyterLite and Emscripten-forge. My use of pyodide and Matplotlib together is restricted to JupyterLite so I don't have particular interest in pyodide outside of JupyterLite, but I see that I am probably in a good position to help here. I'm certainly interested in helping to break down any barriers that have inadvertently appeared between different sections of the python wasm community. |
Hi @ianthomas23, thank you so much for reaching out! Yes, as a part of pyodide/pyodide#4510, we've been able to get the WASM backend to work, and the HTML5 backend is also close to working (seemingly). I would largely agree with the work sequence you have proposed. Still, as a part of (2), I would also say that since the Pyodide release has been delayed by a bit of time already, maybe it would make sense to either get #64 towards completion or patch the code here to use the My summary on the plan of action would be that for now, a review based on the current state of #64 (which is what is being patched into pyodide/pyodide#4510) and some attempts to make it work completely would be beneficial for the release so as to not let that effort go in vain; I've tried to hack around the Canvas API there over the past week, but I am no expert with Matplotlib, of course. Then, your proposed work sequence sounds like the way to go. |
@ianthomas23 Thanks for reaching out, and I am really happy that matplotlib developers are interested in this issue.
We'll need to investigate whether we can make it compatible with Pyodide, but I am +1 on replacing our wasm_backend and HTML5 backend with WebAgg if possible.
This would be ideal for us. I also don't think we can fully upstream the patches, but keeping it minimal would reduce our maintenance burden. |
@agriyakhetarpal Please don't hold off pyodide/pyodide#4510 hoping for a modified WebAgg backend to be available soon. Given the limited time I have to spend on this it is more likely to be a few months before I complete that rather than a few days. Also, starting with Matplotlib 3.8 will be much easier for me than with 3.5. And as @ryanking13 says, I must investigate if WebAgg can be made compatible with Pyodide, at the moment this is a hope a not a guarantee. |
I agree it is a good idea to remove the dependency, and to not break things, simply replace it with the minimum bare bone implementation, like print out a informational message in the implementation FigureManager show() method, saying something like, Thank you all! |
Thanks for the suggestion.
I am not sure if this is related to matplotlib-pyodide. I think we don't do anything about font cache, maybe something has changed in the recent matplotlib versions. |
I wanted to give a quick update. I've started working on patching the Matplotlib webagg backend for use in pyodide and I am progressing well. Hopefully I'll have something to share in a couple of weeks or so. |
Thanks for sharing, @ianthomas23! |
Sorry, I missed this comment, @jsclass42. This message comes from Matplotlib, and not from |
Background
matplotlib
is a critical library for Python users, and many want to use it with Pyodide. To meet this demand,matplotlib-pyodide
was introduced early in Pyodide's history (originating in the predecessor project, Iodide).The project benefited initially from @ mdboom (not linking intentionally as he doesn't work at Pyodide anymore), Pyodide creator and Matplotlib contributor, who developed a Matplotlib backend for Pyodide. However, the current Pyodide core team lacks the deep Matplotlib expertise required to maintain this backend effectively.
This lack of expertise has become a bottleneck, especially during major updates like upgrading NumPy v2. For example, while @agriyakhetarpal has made significant progress on this upgrade, updating and testing matplotlib-pyodide remains a significant challenge.
Proposal
I propose moving matplotlib-pyodide to maintenance-only mode, with the following changes:
Limit New Features:
Only address critical compatibility issues with Matplotlib (e.g., #15). No new feature additions.
Remove Non-Essential, Unmaintainable Features:
By removing these features, we aim to reduce maintenance costs. Alternatively, we could exclude these features from the test suite to avoid blocking releases due to broken tests.
Revisit Maintenance Mode if a Maintainer Emerges:
If a reliable maintainer with sufficient expertise volunteers, we can revoke maintenance-only status.
Additional Context
Tools using the IPython kernel (e.g., JupyterLite) typically use their own Matplotlib backend and do not depend on matplotlib-pyodide. So I believe it would not affect users who use matplotlib in Jupyter-like kernels.
WDYT?
The text was updated successfully, but these errors were encountered: