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

ENH: Better error message on fpath #1097

Merged
merged 2 commits into from Nov 9, 2022
Merged

ENH: Better error message on fpath #1097

merged 2 commits into from Nov 9, 2022

Conversation

larsoner
Copy link
Member

@larsoner larsoner commented Nov 8, 2022

Improves the error message from:

RuntimeError: Found more than one matching data file for the requested recording.
Cannot proceed due to the ambiguity. This is likely a problem with your BIDS dataset.
Please run the BIDS validator on your data.

to

RuntimeError: Found more than one matching data file for the requested recording. While searching:
    BIDSPath(
    root: /home/larsoner/mne_data/ds004024
    datatype: eeg
    basename: sub-CON001_ses-async14ms_task-rest)
Found 4 paths:
    /home/larsoner/mne_data/ds004024/sub-CON001/ses-async14ms/eeg/sub-CON001_ses-async14ms_task-rest_run-01_eeg.vhdr
    /home/larsoner/mne_data/ds004024/sub-CON001/ses-async14ms/eeg/sub-CON001_ses-async14ms_task-rest_run-02_eeg.vhdr
    /home/larsoner/mne_data/ds004024/sub-CON001/ses-async14ms/eeg/sub-CON001_ses-async14ms_task-rest_run-03_eeg.vhdr
    /home/larsoner/mne_data/ds004024/sub-CON001/ses-async14ms/eeg/sub-CON001_ses-async14ms_task-rest_run-04_eeg.vhdr
Cannot proceed due to the ambiguity. This is likely a problem with your BIDS dataset.
Please run the BIDS validator on your data.

which allowed me to see the problem/ambiguity easily.

@codecov
Copy link

codecov bot commented Nov 8, 2022

Codecov Report

Merging #1097 (97e71f8) into main (62fbde8) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1097   +/-   ##
=======================================
  Coverage   95.21%   95.21%           
=======================================
  Files          24       24           
  Lines        3867     3869    +2     
=======================================
+ Hits         3682     3684    +2     
  Misses        185      185           
Impacted Files Coverage Δ
mne_bids/path.py 97.62% <100.00%> (+<0.01%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@sappelhoff sappelhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I love these small improvements. Thanks!

@sappelhoff sappelhoff merged commit 399a488 into mne-tools:main Nov 9, 2022
@larsoner larsoner deleted the msg branch November 9, 2022 12:02
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.

None yet

2 participants