Skip to content

Commit

Permalink
BUG: Fix bug with SNIRF date (mne-tools#12732)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Jul 18, 2024
1 parent f0e50d7 commit 3987aa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mne/io/snirf/_snirf.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def natural_keys(text):
)
birth_matched = re.fullmatch(r"(\d+)-(\d+)-(\d+)", str_birth)
if birth_matched is not None:
birthday = (
birthday = datetime.date(
int(birth_matched.groups()[0]),
int(birth_matched.groups()[1]),
int(birth_matched.groups()[2]),
Expand Down
6 changes: 5 additions & 1 deletion mne/io/snirf/tests/test_snirf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.

import datetime
import shutil

import numpy as np
Expand Down Expand Up @@ -515,7 +516,10 @@ def test_birthday(tmp_path, monkeypatch):
a.save()

raw = read_raw_snirf(fname)
assert raw.info["subject_info"]["birthday"] == (1950, 1, 1)
assert raw.info["subject_info"]["birthday"] == datetime.date(1950, 1, 1)
# TODO: trigger some setting checkers that should maybe be in the reader (like
# those for subject_info)
raw.info.copy()


@requires_testing_data
Expand Down

0 comments on commit 3987aa7

Please sign in to comment.