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
Fix HDF5 utility file handler not decoding byte arrays consistently #1422
Conversation
Congratulations 🎉. DeepCode analyzed your code in 2.871 seconds and we found no issues. Enjoy a moment of no bugs ☀️. 👉 View analysis in DeepCode’s Dashboard | Configure the bot |
Codecov Report
@@ Coverage Diff @@
## master #1422 +/- ##
=======================================
Coverage 90.58% 90.58%
=======================================
Files 236 236
Lines 33797 33820 +23
=======================================
+ Hits 30615 30637 +22
- Misses 3182 3183 +1
Continue to review full report at Codecov.
|
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
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.
Thanks for taking care of this, LGTM
A couple users noticed that some readers are now causing errors when multiple granule's metadata dictionaries are combined. You'll see errors like:
I've tracked this down to at least one specific issue: some readers are putting byte arrays (
ex. b''"'
) in numpy arrays in theirDataArray.attrs
metadata. When attempting to combine metadata satpy sees these as arrays and attempts to combine them. This fails with the above error.Both readers that have encountered this are using the base HDF5 utility file handler. I discovered that although the file handler is converting attributes to regular strings when possible, it is only doing this for attributes accessed through the string form
my_handler['/my_data/attr/some_attr']
but NOT for the DataArray that is produced so doingmy_handler['my_data'].attrs['some_attr]
will have the unconverted data.Additionally this fixes the unstable travis environment failures in the HY2 reader.
flake8 satpy