pytroll / pyresample

Geospatial image resampling in Python
http://pyresample.readthedocs.org
GNU Lesser General Public License v3.0
343 stars 95 forks source link

Add support for `fill_value` and `set_empty_bucket_to` in BucketResampler `get_sum` #602

Open ameraner opened 1 month ago

ameraner commented 1 month ago

This PR adds support for fill_value and set_empty_bucket_to in BucketResampler get_sum. This is a nice feature, but most importantly it fixes the satpy bucket_sum interface.

Closes https://github.com/pytroll/satpy/issues/2805

codecov[bot] commented 1 month ago

Codecov Report

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

Project coverage is 93.98%. Comparing base (56f4506) to head (f3acfb4). Report is 16 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #602 +/- ## ========================================== - Coverage 94.01% 93.98% -0.03% ========================================== Files 92 86 -6 Lines 13836 13775 -61 ========================================== - Hits 13008 12947 -61 Misses 828 828 ``` | [Flag](https://app.codecov.io/gh/pytroll/pyresample/pull/602/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/pytroll/pyresample/pull/602/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pytroll) | `93.98% <100.00%> (-0.03%)` | :arrow_down: | 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 month ago

Coverage Status

coverage: 93.69% (+0.01%) from 93.676% when pulling 512a265247ec3283a50222aa7d186876a6a0c806 on ameraner:fix_bucket_sum_for_fillvalue into db94a87b21bfff43eecb71458f54c574dd344833 on pytroll:main.

coveralls commented 4 weeks ago

Coverage Status

coverage: 93.69% (+0.01%) from 93.676% when pulling 6fc18c64e3f51be41617a6fb4196a920be2a7cd6 on ameraner:fix_bucket_sum_for_fillvalue into db94a87b21bfff43eecb71458f54c574dd344833 on pytroll:main.

ameraner commented 2 weeks ago

I addressed all comments, and most importantly I switched all bucket tests to pytest. I realised there are many ways to do this (like do we need a base test class containing all tests?), so please let me know if you like it like this. I also used fixtures with module scope to optimise it a bit.

I also parametrised the get_sum arguments tests into one test as proposed. It took a while to figure out the combination and simplification of the test flow, but indeed I think it improved the test readability, and made the testing of more corner cases much easier. So thanks for pushing me to do it :)

coveralls commented 2 weeks ago

Coverage Status

coverage: 93.689% (+0.01%) from 93.676% when pulling f3acfb450a858a5039aa7466f69bfa2fdf9b9b26 on ameraner:fix_bucket_sum_for_fillvalue into db94a87b21bfff43eecb71458f54c574dd344833 on pytroll:main.