pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.04k stars 287 forks source link

Fix conversion of valid_range metadata to tuple in viirs_edr reader #2833

Closed djhoese closed 4 days ago

djhoese commented 1 week ago

While testing viirs_edr with our upcoming release of Polar2Grid 3.1, @kathys noticed that the AWIPS tiled writer fails to handle valid_range metadata that is a numpy array. It assumes it is a tuple or something else boolean-able. I can't find any documentation in the Satpy documentation on this, but I'm fairly certain that we tend to recommend either removing metadata fields like valid_range or to convert them to tuples. This PR converts the viirs_edr reader's metadata to a tuple for valid_range and now writing to AWIPS tiled files works as expected.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.94%. Comparing base (8bcd427) to head (aff4f31). Report is 7 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2833 +/- ## ======================================= Coverage 95.94% 95.94% ======================================= Files 366 366 Lines 53504 53522 +18 ======================================= + Hits 51332 51350 +18 Misses 2172 2172 ``` | [Flag](https://app.codecov.io/gh/pytroll/satpy/pull/2833/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | Coverage Δ | | |---|---|---| | [behaviourtests](https://app.codecov.io/gh/pytroll/satpy/pull/2833/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `4.04% <0.00%> (-0.01%)` | :arrow_down: | | [unittests](https://app.codecov.io/gh/pytroll/satpy/pull/2833/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `96.03% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

coveralls commented 1 week ago

Pull Request Test Coverage Report for Build 9586294239

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details


Totals Coverage Status
Change from base Build 9520945640: 0.001%
Covered Lines: 51579
Relevant Lines: 53705

💛 - Coveralls
djhoese commented 4 days ago

I need this pull request for my work. Since everyone is going on vacation, I'm going to flex my github permission muscles and push this through. The overall fix is pretty simple, but we should probably have a larger discussion about the "standard practice" being utilized here.