-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MRG: Test warnings if NIRS channels are not correctly ordered #7491
Conversation
@larsoner @agramfort could you please review this. Thanks The failing CI test seems unrelated |
mne/preprocessing/nirs/nirs.py
Outdated
(int(ch2_name_info.groups()[2]) != freqs[1]): | ||
raise RuntimeError('NIRS channels not ordered correctly') | ||
else: | ||
raise RuntimeError('NIRS channels not ordered correctly') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have used a ValueError and I would give more details on the error eg printing the problematic values. YOu could also avoid copy pasting the error message. besides LGTM
Codecov Report
@@ Coverage Diff @@
## master #7491 +/- ##
==========================================
- Coverage 90.09% 90.05% -0.04%
==========================================
Files 453 453
Lines 82608 82642 +34
Branches 13060 13049 -11
==========================================
- Hits 74424 74422 -2
- Misses 5358 5391 +33
- Partials 2826 2829 +3 |
Thanks @agramfort. Sorry but I tweaked the error messages again after you approved the PR. I tried to better match other code in MNE. |
Pushed a cosmit to reduce the indentation level, will merge once CIs come back happy -- thanks @rob-luke |
Reference issue
General fNIRS tweaking #7057
What does this implement/fix?
Added test to ensure that NIRS data is stored as paired wavelength data. Noticed that if an odd number of channels existed that the check failed.