Skip to content
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

Merged
merged 9 commits into from
Jun 7, 2020

Conversation

simonjayhawkins
Copy link
Member

pre-cursor to #34628

@simonjayhawkins simonjayhawkins added the Typing type annotations, mypy/pyright type checking label Jun 7, 2020
Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -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:
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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?

@WillAyd WillAyd added this to the 1.1 milestone Jun 7, 2020
@WillAyd
Copy link
Member

WillAyd commented Jun 7, 2020 via email

@WillAyd WillAyd merged commit e45b348 into pandas-dev:master Jun 7, 2020
@WillAyd
Copy link
Member

WillAyd commented Jun 7, 2020

Thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the series-interpolate-types branch June 8, 2020 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants