Skip to content

Commit

Permalink
Merge branch 'main' into hed
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Jul 12, 2024
2 parents cecd658 + 4c3e753 commit c92b4fc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ The following authors contributed for the first time. Thank you so much! 🤩

The following authors had contributed before. Thank you for sticking around! 🤘

* `Daniel McCloy`_
* `Stefan Appelhoff`_

Detailed list of changes
Expand All @@ -44,7 +45,7 @@ Detailed list of changes
🪲 Bug fixes
^^^^^^^^^^^^

- nothing yet
- When anonymizing the date of a recording, MNE-BIDS will no longer error during `~mne_bids.write_raw_bids` if passing a `~mne.io.Raw` instance to ``empty_room``. By `Daniel McCloy`_ (:gh:`1270`)

⚕️ Code health
^^^^^^^^^^^^^^
Expand Down
5 changes: 4 additions & 1 deletion mne_bids/tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -3150,13 +3150,16 @@ def test_anonymize(subject, dir_name, fname, reader, tmp_path, _bids_validate):
# handle different edge cases
if subject == "emptyroom":
bids_path.update(task="noise", session=raw_date, suffix="meg", datatype="meg")
erm = dict()
else:
bids_path.update(task="task", suffix="eeg", datatype="eeg")
# make sure anonymization works when also writing empty room file
erm = dict(empty_room=raw.copy())
daysback_min, daysback_max = get_anonymization_daysback(raw)
anonymize = dict(daysback=daysback_min + 1)
orig_bids_path = bids_path.copy()
bids_path = write_raw_bids(
raw, bids_path, overwrite=True, anonymize=anonymize, verbose=False
raw, bids_path, overwrite=True, anonymize=anonymize, verbose=False, **erm
)
# emptyroom recordings' session should match the recording date
if subject == "emptyroom":
Expand Down
2 changes: 1 addition & 1 deletion mne_bids/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -1814,7 +1814,7 @@ def write_raw_bids(
er_bids_path = bids_path.copy().update(
subject="emptyroom", session=er_session, task="noise", run=None
)
write_raw_bids(
er_bids_path = write_raw_bids(
raw=empty_room,
bids_path=er_bids_path,
events=None,
Expand Down

0 comments on commit c92b4fc

Please sign in to comment.