-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TYP: some type annotations for interpolate #34631
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
TYP: some type annotations for interpolate #34631
Conversation
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
pandas/core/missing.py
Outdated
@@ -92,8 +94,7 @@ def clean_fill_method(method, allow_nearest=False): | |||
return method | |||
|
|||
|
|||
def clean_interp_method(method, **kwargs): | |||
order = kwargs.get("order") | |||
def clean_interp_method(method: str, order: Optional[int] = None, **kwargs) -> str: |
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.
Are kwargs even required here any more?
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 would imagine so, split out order so that can add type annotation for internal checks. will double check though.
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.
it doesn't appear that we pass the kwargs through to np.interp (left, right and period) but do for scipy.interpolate.UnivariateSpline
did you mean kwargs not used in this function? That's true, but would need to do order = kwargs.get("order")
in the calling functions if I remove kwargs here. I don't see that as an improvement.
should I revert this change?
Yea I don’t think its that important so if a lot of effort just revert
… On Jun 7, 2020, at 10:35 AM, Simon Hawkins ***@***.***> wrote:
@simonjayhawkins commented on this pull request.
In pandas/core/missing.py <#34631 (comment)>:
> @@ -92,8 +94,7 @@ def clean_fill_method(method, allow_nearest=False):
return method
-def clean_interp_method(method, **kwargs):
- order = kwargs.get("order")
+def clean_interp_method(method: str, order: Optional[int] = None, **kwargs) -> str:
it doesn't appear that we pass the kwargs through to np.interp (left, right and period) but do for scipy.interpolate.interp1d
did you mean kwargs not used in this function? That's true, but would need to do order = kwargs.get("order") in the calling functions if I remove kwargs here. I don't see that as an improvement.
should I revert this change?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#34631 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAEU4UIZQS5KLL7E7JDLFELRVPFULANCNFSM4NXKKNVA>.
|
Thanks @simonjayhawkins |
pre-cursor to #34628