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

[BUG] BIDSpath.update changes suffix option even if suffix isn't supported #949

Closed
teonbrooks opened this issue Jan 29, 2022 · 0 comments · Fixed by #950
Closed

[BUG] BIDSpath.update changes suffix option even if suffix isn't supported #949

teonbrooks opened this issue Jan 29, 2022 · 0 comments · Fixed by #950
Labels
Milestone

Comments

@teonbrooks
Copy link
Member

Describe the bug

When using the BIDSPath option, if you try to update the suffix with a non-supported suffix (e.g. _ave), you will receive an error that the suffix is not supported (intended behavior) but the BIDSPath option is updated regardless (not intended behavior). I believe this is because the _check method is called after setting the suffix instead of being called first.

Steps to reproduce

import mne_bids


bids_path = mne_bids.BIDSPath(subject='test')
bids_path.update(suffix='ave')
bids_path

Expected results

BIDSPath object should not update with the unsupported extension or there should be an ignore option so that the error doesn't occur.

Actual results

In [6]: bids_path.update(suffix='ave')  
ValueError: Suffix ave is not allowed. Use one of these suffixes ['meg', 'markers', 'eeg', 'ieeg', 'T1w', 'FLASH', 'participants', 'scans', 'electrodes', 'channels', 'coordsystem', 'events', 'headshape', 'digitizer', 'beh', 'physio', 'stim'].

In [7]: bids_path                                                               
Out[7]: 
BIDSPath(
root: None
datatype: None
basename: sub-test_ave)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants