Skip to content

Comments

Make panel backend work with multi-thread/multi-process#240

Open
alejoe91 wants to merge 15 commits intoSpikeInterface:mainfrom
alejoe91:panel-parallel
Open

Make panel backend work with multi-thread/multi-process#240
alejoe91 wants to merge 15 commits intoSpikeInterface:mainfrom
alejoe91:panel-parallel

Conversation

@alejoe91
Copy link
Member

@alejoe91 alejoe91 commented Feb 20, 2026

Panel can serv apps with parallelization, but in that case changes to bokeh models (e.g., refresh, change ranges, data sources) need to be "scheduled" using pn.state.execute({function}, schedule=True), otherwise different threads/processes could conflict.

This PR does exactly that by:

  • changing the view base panel refresh to use execute
  • changing direct changes of models to use the same pattern

Also includes a few minor improvements to panel views


self.glyphs_data_source.patch(patch_dict)

patch_dict = {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting an error on refresh:

  File "/home/nolanlab/fromgit/spikeinterface-gui/spikeinterface_gui/probeview.py", line 501, in _panel_refresh
    glyph_patch_dict = self._panel_compute_unit_glyph_patches()
  File "/home/nolanlab/fromgit/spikeinterface-gui/spikeinterface_gui/probeview.py", line 562, in _panel_compute_unit_glyph_patches
    current_alphas = self.glyphs_data_source.data['alpha']
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'alpha'

I guess it has something to do with this code change??

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants