Skip to content

FIX: don't mutate cached ICA sources in plot_sources properties - #14303

Merged
larsoner merged 1 commit into
mne-tools:mainfrom
DerAndereJohannes:ica_pick_fix
Sep 12, 2026
Merged

larsoner merged 1 commit into
mne-tools:mainfrom
DerAndereJohannes:ica_pick_fix

Conversation

@DerAndereJohannes

@DerAndereJohannes DerAndereJohannes commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

What does this implement/fix?

Found a bug when right clicking the IC number on the left side (opening the ica_properties) when in plot_sources. There seems to have been a regression from the previous versions where on the first right click it works fine, but on the second it crashes with an index error:

IndexError: All picks must be < n_channels (1), got array([42]

It turns out that using the picks command was mutating the browser cached data in place and therefore only worked the first time. Regression test was also added. The fix was just adding a copy before doing the picks.

Let me know if you have any other questions.

@larsoner

Copy link
Copy Markdown
Member

Oof yes this looks like a clear bug, thanks @DerAndereJohannes !

@larsoner
larsoner enabled auto-merge (squash) September 12, 2026 15:21
@larsoner
larsoner merged commit 955944d into mne-tools:main Sep 12, 2026
30 checks passed
larsoner pushed a commit that referenced this pull request Sep 12, 2026
… sources in plot_sources properties) (#14305)

Co-authored-by: Johannes Herforth <[email protected]>
larsoner added a commit to natinew77-creator/mne-python that referenced this pull request Sep 14, 2026
* upstream/main:
  Small documentation fix for "Frequency and time-frequency sensor analysis" tutorial (mne-tools#14304)
  FIX: don't mutate cached ICA sources in plot_sources properties (mne-tools#14303)
  Fix bug with lite backend closing (mne-tools#14302)
larsoner added a commit to wmvanvliet/mne-python that referenced this pull request Sep 16, 2026
…d-sphere

* commit '0311e444b0450ce9d2b2b304cebe7d5343533357':
  Fix static doc viewing in IDEs (mne-tools#14195)
  Fix COLA for odd sizes (mne-tools#14312)
  add type hints to mne/_fiff/ module (mne-tools#14278)
  ENH: wire the JupyterLite build into the docs (JupyterLite split 5/5) (mne-tools#14157)
  MAINT: Update pre-commit hook versions (mne-tools#14306)
  Small documentation fix for "Frequency and time-frequency sensor analysis" tutorial (mne-tools#14304)
  FIX: don't mutate cached ICA sources in plot_sources properties (mne-tools#14303)
  Fix bug with lite backend closing (mne-tools#14302)
  Fix for NumPy eig change [circle deploy] (mne-tools#14300)
  No PyQt5 [circle deploy] [skip azp] [skip actions]
  ENH: add the JupyterLite notebook setup cell (JupyterLite split 4/5) (mne-tools#14150)
  FIX: Ver [circle deploy] [skip azp] [skip actions]
  Hotfix
  fix EDF round-trip (mne-tools#14296)
  Brain GUI modernization (Phase 7) (mne-tools#14270)
  Fix bug with SciPy 1.18.0 EEGLAB reading (mne-tools#14293)
  remove plotting abs as the defauls for plotting volumetric (mne-tools#13989)
  Coregistration GUI modernisation (phase 4) (mne-tools#14285)
  Dipole GUI interactivity and visual enhancements (phase 2) (mne-tools#14291)
larsoner added a commit to CarinaFo/mne-python that referenced this pull request Sep 16, 2026
* upstream/main: (91 commits)
  Fix static doc viewing in IDEs (mne-tools#14195)
  Fix COLA for odd sizes (mne-tools#14312)
  add type hints to mne/_fiff/ module (mne-tools#14278)
  ENH: wire the JupyterLite build into the docs (JupyterLite split 5/5) (mne-tools#14157)
  MAINT: Update pre-commit hook versions (mne-tools#14306)
  Small documentation fix for "Frequency and time-frequency sensor analysis" tutorial (mne-tools#14304)
  FIX: don't mutate cached ICA sources in plot_sources properties (mne-tools#14303)
  Fix bug with lite backend closing (mne-tools#14302)
  Fix for NumPy eig change [circle deploy] (mne-tools#14300)
  No PyQt5 [circle deploy] [skip azp] [skip actions]
  ENH: add the JupyterLite notebook setup cell (JupyterLite split 4/5) (mne-tools#14150)
  FIX: Ver [circle deploy] [skip azp] [skip actions]
  Hotfix
  fix EDF round-trip (mne-tools#14296)
  Brain GUI modernization (Phase 7) (mne-tools#14270)
  Fix bug with SciPy 1.18.0 EEGLAB reading (mne-tools#14293)
  remove plotting abs as the defauls for plotting volumetric (mne-tools#13989)
  Coregistration GUI modernisation (phase 4) (mne-tools#14285)
  Dipole GUI interactivity and visual enhancements (phase 2) (mne-tools#14291)
  Width [circle deploy] [skip azp] [skip actions]
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-candidate on-merge: backport to maint/1.13

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants