-
Notifications
You must be signed in to change notification settings - Fork 303
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
Convert times in SEVIRI readers to nanosecond precision to silence warnings #2676
Conversation
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.
Awesome! Thank you!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2676 +/- ##
==========================================
+ Coverage 95.30% 95.32% +0.02%
==========================================
Files 371 371
Lines 52435 52441 +6
==========================================
+ Hits 49971 49988 +17
+ Misses 2464 2453 -11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Pull Request Test Coverage Report for Build 7170478391Warning: This coverage report may be inaccurate.We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
💛 - Coveralls |
np.testing.assert_equal(get_cds_time(days=days, msecs=msecs), expected) | ||
res = get_cds_time(days=days, msecs=msecs) | ||
np.testing.assert_equal(res, expected) | ||
assert ".000000000" in res.__repr__() |
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.
Does this test the dtype? Can this be tested directly, instead of indirectly via string representation?
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.
Hmm, the dtype is dtype('<M8[ns]')
. There is also the ns
part, but I need to dig a bit more (hopefully tomorrow) to find the best way.
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.
Interesting, I thought the precision was more easily accessible. What about
>>> a.dtype.name
'datetime64[ns]'
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.
Or simply
a.dtype == np.dtype("datetime64[ns]")
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.
Oh, that's nice!
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.
Adjusted in df26a58
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.
LGTM, thanks for fixing this!
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.
LGTM!
The SEVIRI readers (at least for HRIT) issues a ton of warnings about not having nanosecond precision for the times passed to DataArray. This PR converts the times to ns precision to silence the warnings, and separates the three associated tests.