-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Annotations
time formats
#13109
base: main
Are you sure you want to change the base?
Fix Annotations
time formats
#13109
Conversation
…s/mne-python into fix_annotations_orig_time
Also updated the docstring for |
The code for annotations works fine, but changing This is an alternative approach to fix the current errors:
but I'm not 100% on how others want to proceed so I'll pause for now. |
Reference issue (if any)
Fixes #13108
What does this implement/fix?
When reading annotations from a csv file, truncates nanoseconds from
orig_time
by converting to the microsecond format. The exception is for the default time of1970-01-01 00:00:00
used in the files whenAnnotations.orig_time=None
, as converting this to microseconds would cause it to be read as a proper time rather than being converted toNone
which is intended.Also truncates nanoseconds from the times in
utils.dataframes._convert_times()
whentime_format="datetime"
by converting todtype=datetime64[us]
.Should this also be done when
time_format="timedelta"
?Finally, updates unit tests that check csv files with nanosecond times get assigned proper
orig_time
when read in and checks thatAnnotations.to_data_frame()
returns times with nanoseconds truncated (which in turn means truncated times are saved).