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
Encode header attributes in CF writer #953
Conversation
Header attributes equal to zero were not included in the global nc attributes.
Codecov Report
@@ Coverage Diff @@
## master #953 +/- ##
=========================================
+ Coverage 86.19% 86.59% +0.4%
=========================================
Files 174 175 +1
Lines 26740 26837 +97
=========================================
+ Hits 23048 23239 +191
+ Misses 3692 3598 -94
Continue to review full report at Codecov.
|
This reverts commit 168321b.
Chose "true" and "false" because that is the json default.
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
This PR introduces encoding of header attributes in the CF writer. The same methods are employed as for dataset attributes (i.e. the standard json encoder plus some extra rules). This also fixes the problem of zero-valued header attributes not being included in the global nc attributes.
Furthermore, I harmonized the encoding of
bool
andnp.bool_
attributes. Currently we have"True"
fornp.bool_
and"true"
for boolean. I chose"true"
and"false"
because that is the json default.flake8 satpy