-
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
Reduce the number of warnings in writer tests #2691
Conversation
The number of warnings went from 182 to 101. Not as bit a reduction as expected, but there are plenty of Numpy warnings I didn't tackle here. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2691 +/- ##
=======================================
Coverage 95.35% 95.35%
=======================================
Files 371 371
Lines 52400 52415 +15
=======================================
+ Hits 49964 49979 +15
Misses 2436 2436
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 7219848054
💛 - Coveralls |
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.
Looks good, just a question
attrs=dict(start_time=start_time, | ||
end_time=end_time)) | ||
with TempFile() as filename: | ||
scn.save_datasets(filename=filename, writer="cf") | ||
with warnings.catch_warnings(): | ||
# The purpose is to use the default time encoding, silence the warning |
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.
so the default time encoding triggers a warning?
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.
Yes, the default of xarray.coding.times.CFDatetimeCoder
seems to be days since <epoch>
and the datatype we end up is integers, so fractional days are not possible without the library converting to float
. I don't know how the time dtype would be set to float
by us, and this was the only case I saw of this warning so didn't use much time investigating.
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.
Ok, so then maybe something for the next iteration of warning smashing.
Update the code where possible, suppress where necessary, to reduce the number of warnings in Satpy writer tests. The remaining are CF version dependant and various Numpy RuntimeWarnings.