Repository navigation
Make the js backend a proper notebook backend - #14333
Conversation
|
Converting to draft since tkoyama010/pyvista-js#634 will take updates from ~2.4s to ~0.4s, and simplify things a little bit for us (we won't need the double-buffering anymore!). We'll require quite a new |
a787d77 to
615da3d
Compare
* upstream/main: (26 commits) Splitting _brain.py into multiple modules (phase 1) (mne-tools#14359) Fix small corner-case bug with moments (mne-tools#14364) Coregistration GUI modernisation (phase 5) (mne-tools#14353) FIX: Prevent memory leak in RawArray by removing data from _init_kwargs (mne-tools#14360) MAINT: Update code credit (mne-tools#14365) type-hint the rest of mne/_fiff (mne-tools#14352) MAINT: Update dependency specifiers (mne-tools#14362) MAINT: Update dependency specifiers (mne-tools#14357) Switch to mne-tools SPEC-0 action (mne-tools#14356) MAINT: Move Pixi file updates to autofix workflow (mne-tools#14345) BUG: Fix SNIRF landmark length unit scaling (mne-tools#14354) DRY dipole code and comment on implementation (mne-tools#14350) Speed up CSD and PSD computations (mne-tools#14355) [dependabot]: Bump the actions group with 4 updates (mne-tools#14349) MAINT: Update pre-commit hook versions (mne-tools#14347) Switch to `mne-tools/rename-towncrier` action (mne-tools#14344) Fix for latest pyvista-js (mne-tools#14343) Avoid copies and support larger files in EEGLAB export (mne-tools#14338) Remove line breaks in sponsors check issue text (mne-tools#14337) Fix EEGLAB events after dropped epochs (mne-tools#14067) ... # Conflicts: # mne/viz/_brain/_brain.py # mne/viz/backends/tests/test_renderer.py
|
Okay this is ready! Can be tested with the "launch lite" button for the dSPM example, which links here and for me gives:
|
|
@natinew77-creator do you want to review this one? |
Thanks for reaching out! I'd be happy to take a look. I'm currently busy with classes and midterm exams, but I'll review it as soon as I have some free time. |
# Conflicts: # mne/viz/_brain/_brain.py # mne/viz/backends/_notebook.py
|
Sorry for the delayed review, I've been quite busy with classes and midterm exams! I pulled the latest commits and tested everything locally with Looks great to me, and I would be happy to see this merged! |
# Conflicts: # tools/ci/macos-intel/pixi.lock
|
Okay this was approved by @natinew77-creator and greatly improves the jupyterlite experience so I'll merge! |

Make the "jupyterlite" backend an actual interactive backend named
notebook_js. Performance is not great because on changes the whole thing needs to be re-serialized, but I'm going to work on streamlining that at thepyvista-jsend. Changes ended up being pretty simple, with the exception being due to this re-serialization -- we need to "double buffer", i.e., render to a new widget fully before swapping, rather than a bare replace in order to avoid flashing. And we need some JS to make it clear an interactive update is in progress but waiting on the serialization. In the meantime zooming and rotating etc. is faster than thenotebookbackend (and the abstraction helps our code readability actually I think).This code:
in a Jupyter notebook gives:
Also fixes a little double-event-publish bug along the way.
Changes drafted with Claude Opus 5.5 (especially helping with the JS!) but understood and iterated on by me.