mne-tools / mne-bids

MNE-BIDS is a Python package that allows you to read and write BIDS-compatible datasets with the help of MNE-Python.
https://mne.tools/mne-bids/
BSD 3-Clause "New" or "Revised" License
131 stars 85 forks source link

MRG: Correctly handle reading when BIDS channel order differs from Raw #1171

Closed hoechenberger closed 11 months ago

hoechenberger commented 11 months ago

Fixes #1170

@moritz-gerster does this fix your problem?

Merge checklist

Maintainer, please confirm the following before merging. If applicable:

codecov[bot] commented 11 months ago

Codecov Report

Merging #1171 (3c9fbaf) into main (2de8536) will decrease coverage by 0.06%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1171      +/-   ##
==========================================
- Coverage   97.63%   97.57%   -0.06%     
==========================================
  Files          40       40              
  Lines        8655     8662       +7     
==========================================
+ Hits         8450     8452       +2     
- Misses        205      210       +5     
Files Coverage Δ
mne_bids/read.py 95.87% <100.00%> (-0.02%) :arrow_down:
mne_bids/tests/test_read.py 99.71% <100.00%> (+<0.01%) :arrow_up:

... and 3 files with indirect coverage changes

moritz-gerster commented 11 months ago

@moritz-gerster does this fix your problem?

Yes, that works! :)

hoechenberger commented 11 months ago

I believe a common use case is that you realize two EEG electrodes were accidentally swapped, hence you change their order in channels.tsv. With this PR branch, you don't have to worry about fixing the raw file too