Skip to content
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 HDF4 handling of scalar attributes #969

Merged
merged 1 commit into from Nov 15, 2019

Conversation

djhoese
Copy link
Member

@djhoese djhoese commented Nov 15, 2019

I'm not sure if this is caused by a new version of numpy, changes to the dtype handling that I did a while back in the HDF4 file handler, or something else. The HDF4 utility file handler is returning all attributes as numpy arrays even if they are scalar attributes. This PR should fix this.

The other option I thought about doing is adding an if statement earlier in the attribute function that checks if the data isn't a numpy array then don't touch it. I'm not sure if this would be good or bad.

  • Tests added and test suite added to parent suite
  • Tests passed
  • Passes flake8 satpy

@djhoese djhoese added the bug label Nov 15, 2019
@djhoese djhoese self-assigned this Nov 15, 2019
@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 86.783% when pulling 9d7cad0 on djhoese:bugfix-clavrx-3 into bf60e6a on pytroll:master.

@codecov
Copy link

codecov bot commented Nov 15, 2019

Codecov Report

Merging #969 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #969      +/-   ##
==========================================
+ Coverage   86.76%   86.78%   +0.01%     
==========================================
  Files         179      179              
  Lines       27300    27305       +5     
==========================================
+ Hits        23688    23696       +8     
+ Misses       3612     3609       -3
Impacted Files Coverage Δ
satpy/readers/hdf4_utils.py 96.49% <100%> (+3.76%) ⬆️
satpy/tests/reader_tests/test_hdf4_utils.py 92.53% <100%> (+0.34%) ⬆️
satpy/scene.py 90.53% <0%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf60e6a...9d7cad0. Read the comment docs.

@djhoese djhoese merged commit a357f4a into pytroll:master Nov 15, 2019
@djhoese djhoese deleted the bugfix-clavrx-3 branch November 15, 2019 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants