matplotlib / matplotlib/ipympl

ipympl does not work in JupyterLite

Offen
#334 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Jupyter Notebook
Sterne
1.7k
Forks
234
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## Describe the issue

Due to a dependency on `tornado` https://github.com/matplotlib/matplotlib/blob/c06e8709dde6504d396349c0c80ef019c88c3927/lib/matplotlib/backends/backend_webagg_core.py#L22, ipympl does not work in [JupyterLite](https://github.com/jtpio/jupyterlite)

We might be able to implement a custom Timer https://github.com/matplotlib/matplotlib/blob/c06e8709dde6504d396349c0c80ef019c88c3927/lib/matplotlib/backends/backend_webagg_core.py#L118 based entirely on `asyncio` (which works on JupyterLite).

## Workaround

As a workaround, one could do
```python
import sys
import types

sys.modules['tornado'] = types.ModuleType('tornadofake')
```

Disclaimer, I would not be held responsible for anything that would go wrong if you copy this code!

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit matplotlibs lib/matplotlib/backends/backend_webagg_core.py, insbesondere mit der tornado-Abhängigkeit nahe Zeile 22 und dem Timer um Zeile 118. Prüfe, wie ipympl dieses Backend in JupyterLite erreicht, und verifiziere anschließend, dass die Integration dort ohne tornado funktioniert und interaktive Timer weiterhin mithilfe der verfügbaren asyncio-Unterstützung funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
jupyter-notebook, python
Bereich
frontend, web-dev
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.