Skip to content

Commit

Permalink
[MRG] Edit 'no events found' warning for resting state data - Reopened (
Browse files Browse the repository at this point in the history
#631)

* reapply old branch commit

* change rest warning to logger.info

* tiny fix

* Use latest setup-node 1.x

* warn

* Update mne_bids/read.py

Co-authored-by: Richard Höchenberger <[email protected]>

* add verbose check

* rm verbose check

* pep8

* change task_rest to rest

Co-authored-by: Alexandre Gramfort <[email protected]>
Co-authored-by: Richard Höchenberger <[email protected]>
  • Loading branch information
3 people authored Dec 14, 2020
1 parent 399646f commit 03f78e5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mne_bids/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ def _read_events(events_data, event_id, raw, verbose=None):
verbose=verbose
)
all_dur = raw.annotations.duration
if all_events.size == 0:
warn('No events found or provided. Please add annotations to the raw '
'data, or provide the events_data and event_id parameters.')
if all_events.size == 0 and 'rest' not in raw.filenames[0]:
warn('No events found or provided. Please add annotations '
'to the raw data, or provide the events_data and '
'event_id parameters. If this is resting state data '
'it is recommended to name the task "rest".')

return all_events, all_dur, all_desc

Expand Down

0 comments on commit 03f78e5

Please sign in to comment.