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

Maintain categorical clavrx data as integer arrays #1792

Merged
merged 3 commits into from
Aug 16, 2021

Conversation

joleenf
Copy link
Contributor

@joleenf joleenf commented Aug 13, 2021

Fixes bug that turns categorical data into float arrays after the valid_range is applied. This is done by using the fill value to fill the data outside of the valid_range for integer. This PR also adds tests to make verify that int arrays have _FillValue and remain integer, while float arrays have no _FillValue in the output attributes and remain float.

@codecov
Copy link

codecov bot commented Aug 13, 2021

Codecov Report

Merging #1792 (569f847) into main (4c7c94b) will decrease coverage by 0.00%.
The diff coverage is 92.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1792      +/-   ##
==========================================
- Coverage   92.90%   92.90%   -0.01%     
==========================================
  Files         265      265              
  Lines       38970    38979       +9     
==========================================
+ Hits        36205    36213       +8     
- Misses       2765     2766       +1     
Flag Coverage Δ
behaviourtests 4.77% <0.00%> (-0.01%) ⬇️
unittests 93.44% <92.30%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
satpy/readers/clavrx.py 90.26% <66.66%> (-0.34%) ⬇️
satpy/tests/reader_tests/test_clavrx.py 100.00% <100.00%> (ø)
satpy/tests/reader_tests/test_clavrx_nc.py 100.00% <100.00%> (ø)

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 4c7c94b...569f847. Read the comment docs.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.001%) to 93.386% when pulling 569f847 on joleenf:categorical_clavrx into 7c27fa4 on pytroll:main.

Copy link
Member

@djhoese djhoese left a comment

Choose a reason for hiding this comment

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

Looks good to me. Is there anything else you wanted to do on this?

@joleenf
Copy link
Contributor Author

joleenf commented Aug 16, 2021

No.

@djhoese djhoese merged commit ab5fb2c into pytroll:main Aug 16, 2021
simonrp84 pushed a commit to simonrp84/satpy that referenced this pull request Nov 24, 2021
* Fix categorical data by making sure fill_value is applied as an integer.
Keep old behavior for non-integer data

* Test that int data remains integer after loading.

* Add some type checking and check there is a _FillValue for int but not float

Co-authored-by: Joleen Feltz <joleenf@ssec.wisc.edu>
@joleenf joleenf deleted the categorical_clavrx branch December 8, 2022 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants