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

Cleanup hy2 reader #2268

Conversation

TAlonglong
Copy link
Collaborator

@TAlonglong TAlonglong commented Nov 10, 2022

Clean up hy2 reader to preserve the attribute over when scaling and masking. This to keep the rename of the attribute with space valid range to valid_range

The previous tests did not catch this because the the renaming of the valid range attribute happened int the test environment as a reference. However in real data files this was to progressed.

To simulate this I made a override of __getitem__ to make a copy of the data instead of a reference.

This was done in the PR #2211, but badly messed up. This is a diff from that branch witch is applied here. Hope this is not to bad.

…e of valid range with space. Added test to test this
@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Merging #2268 (004d910) into main (6081a02) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2268   +/-   ##
=======================================
  Coverage   94.25%   94.25%           
=======================================
  Files         300      300           
  Lines       45649    45669   +20     
=======================================
+ Hits        43026    43046   +20     
  Misses       2623     2623           
Flag Coverage Δ
behaviourtests 4.66% <0.00%> (-0.01%) ⬇️
unittests 94.90% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
satpy/readers/hy2_scat_l2b_h5.py 98.33% <100.00%> (+0.11%) ⬆️
satpy/tests/reader_tests/test_hy2_scat_l2b_h5.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 94.85% when pulling 004d910 on TAlonglong:issue2208-hy2-scat-l2b-h5-valid-range-cherrypick into 6081a02 on pytroll:main.

Copy link
Member

@mraspaud mraspaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup, LGTM!

@mraspaud mraspaud added component:readers cleanup Code cleanup but otherwise no change in functionality labels Nov 11, 2022
@mraspaud mraspaud merged commit df8ddd1 into pytroll:main Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code cleanup but otherwise no change in functionality component:readers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

hy2_scat_l2b_h5 reader does not work any more due to space in valid range attribute
3 participants