-
Notifications
You must be signed in to change notification settings - Fork 86
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
Allow timezone-naive timestamps reference time on read #2056
base: dev
Are you sure you want to change the base?
Conversation
@@ -491,7 +491,9 @@ def __init__(self, **kwargs): | |||
if timestamps_reference_time is None: | |||
args_to_set['timestamps_reference_time'] = args_to_set['session_start_time'] | |||
elif timestamps_reference_time.tzinfo is None: | |||
raise ValueError("'timestamps_reference_time' must be a timezone-aware datetime object.") | |||
self._error_on_new_pass_on_construct( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that timezone information is automatically added to session_start_time
if it is missing. Instead of throwing an error, would it be better to also automatically add timezone information to timestamps_reference_time
if missing?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2056 +/- ##
=======================================
Coverage 92.85% 92.85%
=======================================
Files 28 28
Lines 2756 2756
Branches 716 716
=======================================
Hits 2559 2559
Misses 127 127
Partials 70 70
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Motivation
Fix #2054. Allow files with a timestamps reference time that is not timezone-aware to be read.
How to test the behavior?
In MATLAB:
In python:
Checklist
ruff check . && codespell
from the source directory.