Skip to content
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

Merged
merged 4 commits into from
Mar 23, 2020

Conversation

rob-luke
Copy link
Member

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.

@rob-luke
Copy link
Member Author

@larsoner @agramfort could you please review this. Thanks

The failing CI test seems unrelated

@rob-luke rob-luke changed the title WIP: Test warnings if NIRS channels are not correctly ordered MRG: Test warnings if NIRS channels are not correctly ordered Mar 22, 2020
(int(ch2_name_info.groups()[2]) != freqs[1]):
raise RuntimeError('NIRS channels not ordered correctly')
else:
raise RuntimeError('NIRS channels not ordered correctly')
Copy link
Member

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
Copy link

codecov bot commented Mar 22, 2020

Codecov Report

Merging #7491 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

@@            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

@rob-luke
Copy link
Member Author

Thanks @agramfort. Sorry but I tweaked the error messages again after you approved the PR. I tried to better match other code in MNE.

@larsoner
Copy link
Member

Pushed a cosmit to reduce the indentation level, will merge once CIs come back happy -- thanks @rob-luke

@larsoner larsoner added this to the 0.20 milestone Mar 23, 2020
@larsoner larsoner merged commit e7cee41 into mne-tools:master Mar 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants