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 #1080

Merged
merged 3 commits into from
Oct 13, 2022
Merged

ENH: Better error message #1080

merged 3 commits into from
Oct 13, 2022

Conversation

larsoner
Copy link
Member

Running MNE-BIDS-Pipeline I got a slightly cryptic error:

  File "/home/larsoner/python/mne-bids-pipeline/mne_bids_pipeline/scripts/preprocessing/_02_frequency_filter.py", line 101, in get_input_fnames_frequency_filter
    in_files[f'raw_run-{run}'].find_empty_room()
  File "/home/larsoner/python/mne-bids/mne_bids/path.py", line 957, in find_empty_room
    assert er_bids_path.fpath.exists()

AssertionError

I realized the problem with my dataset (I excluded some files while downloading), but I think this new error message would have helped:

  File "/home/larsoner/python/mne-bids-pipeline/mne_bids_pipeline/scripts/preprocessing/_02_frequency_filter.py", line 101, in get_input_fnames_frequency_filter
    in_files[f'raw_run-{run}'].find_empty_room()
  File "/home/larsoner/python/mne-bids/mne_bids/path.py", line 957, in find_empty_room
    raise FileNotFoundError(

FileNotFoundError: Empty-room BIDS path resolved but not found:
/home/larsoner/mne_data/ds000247/sub-emptyroom/ses-18901014/meg/sub-emptyroom_ses-18901014_task-noise_run-01_meg.ds
Check your BIDS dataset for completeness.

@codecov
Copy link

codecov bot commented Oct 13, 2022

Codecov Report

Merging #1080 (a74c895) into main (b522269) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1080   +/-   ##
=======================================
  Coverage   95.19%   95.19%           
=======================================
  Files          24       24           
  Lines        3847     3847           
=======================================
  Hits         3662     3662           
  Misses        185      185           
Impacted Files Coverage Δ
mne_bids/path.py 97.58% <100.00%> (ø)

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

@larsoner
Copy link
Member Author

CI failure is coverage, but I'm not sure there is a good way to test this, unless it's easy to fake a BIDS dataset that should have an associated empty-room data based on its sidecar but doesn't...

@larsoner
Copy link
Member Author

Nice testing infrastructure, it was easy 👍

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 and clean, thanks @larsoner!

@sappelhoff sappelhoff merged commit 76cc65f into mne-tools:main Oct 13, 2022
@larsoner larsoner deleted the err branch October 13, 2022 21:47
sappelhoff pushed a commit to sappelhoff/mne-bids that referenced this pull request Oct 21, 2022
* ENH: Better error message

* FIX: Beautiful infrastructure

* FIX: Spacing
sappelhoff added a commit that referenced this pull request Oct 21, 2022
* avoid creating many Annotations objects in for loop (#1079)

* ENH: Better error message (#1080)

* ENH: Better error message

* FIX: Beautiful infrastructure

* FIX: Spacing

* ENH: Improve error message (#1081)

* ENH: Improve error message

* FIX: Use working openneuro-py

* FIX: Install

* FIX: Name

* ENH: Make suggestion (#1087)

* MRG: Enforce specification of all annotation descriptions in event_id if event_id is passed to write_raw_bids() (#1086)

* Write all annotations even if event_id was passed

* Implement new logic

* Update changelog

* Fix tests

* Style

* REL: v0.11.1

Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
Co-authored-by: Richard Höchenberger <richard.hoechenberger@gmail.com>
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