Skip to content

Commit

Permalink
Fix warning given if no events are written and task is resting state (#…
Browse files Browse the repository at this point in the history
…1327)

* add chpi to known channel list

* removed some ch types from testing

* change chpi to BIDS type HLU

* adapt changelog

* remove myself from authors again?

* fix logic in warning if no events are written

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* adapt changelog

* revert removal of empty line

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
skjerns and pre-commit-ci[bot] authored Oct 22, 2024
1 parent c1d59ec commit fba8609
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Detailed list of changes
- When processing subject_info data that MNE Python imports as numpy arrays with only one item, MNE-BIDS now unpacks these, resulting in a correct participants.tsv, by `Thomas Hartmann`_ (:gh:`1310`)
- Fixed broken links in examples 7 and 8, by `William Turner`_ (:gh:`1316`)
- All valid extensions for ``README`` files are now accepted. This prevents an extra ``README`` file being created, when one with a ``.txt``, ``.md``, or ``.rst`` extension is already present. By `Thomas Hartmann`_ (:gh:`1318`)
- A warning was given if no events were provided but the task was starting with 'rest' as recommended by `Simon Kern`_ (:gh:`1327`)

⚕️ Code health
^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion mne_bids/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def _read_events(events, event_id, raw, bids_path=None):
# Warn about missing events if not rest or empty-room data
if (all_events.size == 0 and bids_path.task is not None) and (
not bids_path.task.startswith("rest")
or not (bids_path.subject == "emptyroom" and bids_path.task == "noise")
and not (bids_path.subject == "emptyroom" and bids_path.task == "noise")
):
warn(
"No events found or provided. Please add annotations to the raw "
Expand Down

0 comments on commit fba8609

Please sign in to comment.