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
Fix args of bucket_sum and bucket_avg resampler #1539
Fix args of bucket_sum and bucket_avg resampler #1539
Conversation
The changes in Pyresample that call for this PR have not been released yet. Should we wait to merge this PR until the new Pyresample release comes out, or how do we deal with these situations? |
Codecov Report
@@ Coverage Diff @@
## master #1539 +/- ##
==========================================
+ Coverage 92.54% 92.85% +0.30%
==========================================
Files 251 251
Lines 36801 37255 +454
==========================================
+ Hits 34058 34593 +535
+ Misses 2743 2662 -81
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
DeepCode failed to analyze this pull requestSomething went wrong despite trying multiple times, sorry about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you accept the mask_all_nans
kwarg and if provided raise an exception to update pyresample. Or you could map it to the new kwarg and issue a warning. I'll leave that up to you.
Hi @djhoese thanks for the review, I added a DeprecationWarning for the old kwarg. There is still a bit of an issue with the Satpy/Pyresample versions here due to the renaming of the arguments: So if we want Satpy to work with the current and older Pyresample releases, we would need to catch the TypeError (or inspect the function arguments) and pass the old kwarg with warnings. Otherwise we wait to merge this PR until the next Pyresample release and put a requirement. I suppose the first is preferred? |
Yeah not great is it. I was going to say let's leave it because I'm not a fan of inspecting functions for their arguments BUT what if you checked the version of pyresample at the top of the module? Like |
@djhoese thanks for the hint, that sounds like a good idea! I tried to implement it in the last commit. To compare the versions I had to import |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the way you did it is fine. I personally think I would have done the "more wrong" way of just string comparisons.
I had one issue with your new function and commented below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you have some linting/website issues which I've comment on, but otherwise I think the logic looks good. Thanks for looking it over again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I also never use the bucket resampler. If @pnuu could review before a merge that would be appreciated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
This PR fixes the
bucket_sum
andbucket_avg
resampler in Satpy, adapting for the changes in pyresample's PR pytroll/pyresample#319 .On the side, it also fixes a small typo in the readers docs.
flake8 satpy