Open schneijan opened 3 years ago
there is a use case for files with absolute time stamps and a relative.
what was discussed in the past is that .csv will be index by time to orig_time None is hard to make it work ok. What I would suggest is to prevent saving annotations to csv without a valid orig_time
(@agramfort - I think you meant "prevent" so I took the liberty to correct the typo :) )
Bumping to the next release milestone, I don't think we can look into this in the next couple of days
Describe the bug
When creating annotations with
orig_time=None
and saving them to a*.csv
file using thesave
function,orig_time=None
is ignored and replaced by1970-01-01 00:00:00
. Thus, when importing the annotations again, theorig_time
of the imported annotations differs from the original ones. This seems odd to me and not intended, because the issue does not occur when saving the annotations to*.txt
fileSteps to reproduce
Here is a minimal working example:
Expected results
I expected the output to be
None
. This is even the result when using a*.txt
file instead of a*.csv
file.Actual results
1970-01-01 00:00:02.500000+00:00
In the annotations dict, the orig_time is stored as('orig_time', datetime.datetime(1970, 1, 1, 0, 0, 2, 500000, tzinfo=datetime.timezone.utc))