-
Notifications
You must be signed in to change notification settings - Fork 84
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
Increase stacklevel of timezone warning #1641
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #1641 +/- ##
==========================================
+ Coverage 91.32% 91.43% +0.11%
==========================================
Files 25 25
Lines 2535 2535
Branches 481 481
==========================================
+ Hits 2315 2318 +3
+ Misses 139 137 -2
+ Partials 81 80 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Although it is not that relevant to this PR, could you please add a test for |
Otherwise, looks good to me. Thanks! |
This reverts commit 3e0e71e.
Motivation
I just ran across a confusing case during a conversion.
I'm setting both
session_start_time
and the subect'sdate_of_birth
.I intentionally set the
tzinfo
for thedatetime
of thesession_start_time
, but was very confused for while as to why I kept getting the warning from PyNWB about not having set a timezone.Little did I know it was not coming from the
session_start_time
(which 90+% of the time is the cause of that warning), but it was from https://github.com/NeurodataWithoutBorders/pynwb/blob/dev/src/pynwb/file.py#L120 which does the same thing to the subjectdate_of_birth
.Using a higher
stacklevel
would have saved me a lot of time figuring this out, because it would have shown me a line in the traceback related to the field that was being parsed.Checklist
flake8
from the source directory.