-
Notifications
You must be signed in to change notification settings - Fork 12
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
Pass kwargs to interpolate_over_time
#383
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #383 +/- ##
==========================================
+ Coverage 99.79% 99.80% +0.01%
==========================================
Files 14 14
Lines 969 1019 +50
==========================================
+ Hits 967 1017 +50
Misses 2 2 ☔ View full report in Codecov by Sentry. |
interpolate_over_time
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.
Thanks @niksirbi for the quick action!
I've briefly discussed this PR with @sfmig and we both agree that the interpolation method
is rather important and should remain in the function signature.
I think, for clarity, **kwargs
should be the exact **kwargs
that xarray.DataArray.interpolate_na(dim=None, method='linear', limit=None, use_coordinate=True, max_gap=None, keep_attrs=None, **kwargs)
expects to be passed to the underlying numpy.interp or scipy.interpolate.
Co-authored-by: Chang Huan Lo <[email protected]>
Quality Gate passedIssues Measures |
Thanks for the review @lochhh. I was anyway unsure about the removal of |
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 🚀 Thanks again @niksirbi!
Description
What is this PR
Why is this PR needed?
See #379
What does this PR do?
**kwargs
to theinterpolate_over_time()
function, so that additional keyword arguments can be passed to underlying methods.fill_value="extrapolate"
is no longer hard-coded, instead the user may alter this parameter via the aforementioned**kwargs
. Henceworth, gaps at the edges of time series will not be filled by default.method
argument frominterpolate_over_time()
function signature, as this is passed verbatim to underlying functions.max_gap
argument, as its meaning is slightly different fromDataArray.interpolate_na()
.How has this PR been tested?
The aforementioned changes broke the filtering integration test, because that test was expecting
interpolate_over_time()
to eliminate all missing values. I altered that test by explicitly passingfill_value="extrapolate"
to it, which made it pass; this additionally acts as an implicit test that kwargs are indeed being forwarded.Is this a breaking change?
No, as previous syntaxes will still work, but it changes the default expected behaviour.
Does this PR require an update to the documentation?
Yes, the
filter_and_interpolate.py
and thesmooth.py
examples have been updated accordingly. API docs are automatically refreshed due to the changes in the docstring.Checklist: