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

FIX: don't mutate cached ICA sources in plot_sources properties#14303
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 <johannes@herforth.net>
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