Set summed bin without data to fill_value
The get_sum() function doesn't accept the fill_value kwarg and will raise error. We can set it as kwrgs with the np.nan default value.
So, if there's no input of fill_value, summation will be 0 for bins without data. If the fill_value exists, then set it to fill_value.
- [ ] Closes #354
- [ ] Tests added
- [ ] Tests passed
- [x] Passes
git diff origin/main **/*py | flake8 --diff - [x] Fully documented
Codecov Report
Attention: 1 lines in your changes are missing coverage. Please review.
Comparison is base (
a5bc062) 94.05% compared to head (f4e0f69) 94.04%.
| Files | Patch % | Lines |
|---|---|---|
| pyresample/bucket/__init__.py | 80.00% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #364 +/- ##
==========================================
- Coverage 94.05% 94.04% -0.01%
==========================================
Files 90 90
Lines 13575 13578 +3
==========================================
+ Hits 12768 12770 +2
- Misses 807 808 +1
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 94.04% <80.00%> (-0.01%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
coverage: 93.643% (-0.006%) from 93.649% when pulling f4e0f694b4f2ea1f4e088f4e52811b11c647405e on zxdawn:sum_fillvalue into a5bc0629fffd3f17392e60b6a72375f9ef87578b on pytroll:main.
@zxdawn or @pnuu is this still useful or needed? It looks like we missed reviewing this and I have typically stayed away from bucket resampler changes as I don't understand most of it.
I suppose so. Because get_min, get_max, get_average, and get_fractions all have this option.
@pnuu could you have a look here?
Will do after my current endeavor with reader warnings.
Oh no, the code has changed so much that resolving the conflicts will take some time :see_no_evil:
At least the existing tests now pass (locally).
Yes, there should. @zxdawn do you have time to add something? I might have some time on monday, just need to remember...
I'll turn this into a draft for now then.
Maybe I have some time on Sunday or Tuesday.