Repository navigation
ENH: Allow setting non-UTC timezone in set_meas_date (#9953) - #14436
Open
ishaaaan17 wants to merge 1 commit into
Open
ishaaaan17 wants to merge 1 commit into
ishaaaan17 wants to merge 1 commit into
Conversation
ishaaaan17
requested review from
agramfort,
drammock and
larsoner
as code owners
October 20, 2026 09:39
ishaaaan17
force-pushed
the
fix/allow-non-utc-meas-date
branch
from
October 20, 2026 10:13
b47a396 to
526462e
Compare
ishaaaan17
force-pushed
the
fix/allow-non-utc-meas-date
branch
from
October 20, 2026 10:24
526462e to
26239aa
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary of changes
fixes #9953.
this builds on and finishes the abandoned PR #10970 by @TzionaN, rebased onto the current
mainand adapted tomne/_fiff/meas_info.py.before this,
set_meas_dateraised aValueErrorif you gave it a timezone-awaredatetimeobject with a non-UTC timezone, while settinginfo['utc_offset']directly was deprecated.this change does these things:
set_meas_datenow accepts timezone-aware non-UTCdatetimeobjects, converts them to UTC forinfo['meas_date'], and fillsinfo['utc_offset']automatically with the formatted offset (for example+02:00or-05:00).info['utc_offset'] = Nonewhenmeas_dateis in UTC orNone._handle_meas_date.mne/_fiff/tests/test_meas_info.py(including a FIFF I/O save/reload roundtrip and anonymization) and inmne/tests/test_annotations.py.doc/changes/dev/9953.bugfix.rst.ai disclosure
i used an ai assistant to trace how
utc_offsetis formatted in FIFF and howInfo.set_meas_dateis structured acrossmne/_fiff/meas_info.pyandmne/annotations.py. i checked the offset calculation logic, wrote the round-trip and anonymization tests, formatted the code withruff, and ran the pytest suite locally before pushing.