pyresample icon indicating copy to clipboard operation
pyresample copied to clipboard

Set summed bin without data to fill_value

Open zxdawn opened this issue 4 years ago • 11 comments

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

zxdawn avatar May 28 '21 13:05 zxdawn

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.

codecov[bot] avatar May 31 '21 03:05 codecov[bot]

Coverage Status

coverage: 93.643% (-0.006%) from 93.649% when pulling f4e0f694b4f2ea1f4e088f4e52811b11c647405e on zxdawn:sum_fillvalue into a5bc0629fffd3f17392e60b6a72375f9ef87578b on pytroll:main.

coveralls avatar May 31 '21 03:05 coveralls

@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.

djhoese avatar Mar 22 '22 01:03 djhoese

I suppose so. Because get_min, get_max, get_average, and get_fractions all have this option.

zxdawn avatar Mar 22 '22 10:03 zxdawn

@pnuu could you have a look here?

mraspaud avatar Dec 13 '23 09:12 mraspaud

Will do after my current endeavor with reader warnings.

pnuu avatar Dec 13 '23 09:12 pnuu

Oh no, the code has changed so much that resolving the conflicts will take some time :see_no_evil:

pnuu avatar Dec 15 '23 09:12 pnuu

At least the existing tests now pass (locally).

pnuu avatar Dec 15 '23 10:12 pnuu

Yes, there should. @zxdawn do you have time to add something? I might have some time on monday, just need to remember...

pnuu avatar Dec 15 '23 12:12 pnuu

I'll turn this into a draft for now then.

mraspaud avatar Dec 15 '23 13:12 mraspaud

Maybe I have some time on Sunday or Tuesday.

zxdawn avatar Dec 15 '23 13:12 zxdawn