Skip to content

Commit

Permalink
added alphanumeric subject to participants testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronearlerichardson committed Aug 23, 2024
1 parent 83c7d6e commit 8507647
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mne_bids/tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,17 @@ def test_write_participants(_bids_validate, tmp_path):
write_raw_bids(raw, bids_path, verbose=False)
data = _from_tsv(participants_tsv)

# write an alphanumeric subject
bids_path.update(subject="D04")
write_raw_bids(raw, bids_path, verbose=False)
data = _from_tsv(participants_tsv)

# hand should have been written properly with now 'n/a' for sub-01 and
# sub-03, but 'L' for sub-03
assert data["hand"][data["participant_id"].index("sub-01")] == "n/a"
assert data["hand"][data["participant_id"].index("sub-02")] == "n/a"
assert data["hand"][data["participant_id"].index("sub-03")] == "L"
assert data["hand"][data["participant_id"].index("sub-D04")] == "L"

# check to make sure participant data is overwritten, but keeps the fields
# if there are extra fields that were user defined
Expand Down

0 comments on commit 8507647

Please sign in to comment.