You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mne.concatenate_raws(raws) wrongly concatenates raws if the order of the channel names varies across raws #11633
mne.concatenate_raws(raws) wrongly concatenates raws if the order of the channel names varies across raws.
In my opinion, this is a huge bug that I noticed only accidentally. In my data, I add reference channels when they are missing and the index of this channel varies across my raws. In other words, the order of raw.ch_names is not consistent across my raws.
We should probably prepare the raws within mne.concatenate_raws with
I don't think we can expect all mne users to know this and do it themselves. I would have never thought that this function does not check the names of the channels it concatenates.
Steps to reproduce
Seejupyter-notebookpdfabove.
Link to data
No response
Expected results
mne.concatenate_raws reads in the channel names and only concatenates "ch1" of raw1 with "ch1" of raw2.
Actual results
mne.concatenate_raws concatenates raw1.ch_names[0] with raw2.ch_names[0] without checking whether raw1.ch_names[0] == raw2.ch_names[0].
sklearn: 1.2.1
numba: Not found
nibabel: 5.0.1
nilearn: Not found
dipy: Not found
openmeeg: Not found
cupy: Not found
pandas: 1.5.3
pyvista: Not found
pyvistaqt: Not found
ipyvtklink: Not found
vtk: Not found
qtpy: Not found
ipympl: Not found
pyqtgraph: Not found
pooch: v1.6.0
mne_bids: 0.12
mne_nirs: Not found
mne_features: Not found
mne_qt_browser: Not found
mne_connectivity: Not found
mne_icalabel: Not found
Activity
larsoner commentedon Apr 17, 2023
Sure this seems reasonable, can you open a PR for this?
moritz-gerster commentedon Apr 20, 2023
@larsoner done 👍