mne-tools / mne-python

MNE: Magnetoencephalography (MEG) and Electroencephalography (EEG) in Python
https://mne.tools
BSD 3-Clause "New" or "Revised" License
2.68k stars 1.31k forks source link

info['subject_info']['birthday'] should support a datetime object #11327

Closed hoechenberger closed 2 months ago

hoechenberger commented 1 year ago

Describe the new feature or enhancement

Working on https://mne.discourse.group/t/minor-priority-issue-with-converting-mne-raw-into-bids-with-mne-bids-age-birthday-info-of-subject/5922, I realized that a subject's birthday must be specified as a tuple of ints. I believe this is inconsistent with the way we allow to specify the measurement date (datetime object).

Describe your proposed implementation

It should be possible to specify Info['subject_info']['birthday'] as a datetime.datetime object.

Describe possible alternatives

Additional context

No response

hoechenberger commented 1 year ago

@larsoner Any opinion on that?

larsoner commented 1 year ago

Agreed this makes sense. We can gradually transform these tuple-of-two-int into datetime as we find them.