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

REF/TYP: pandas/core/window/*.py #37091

Merged
merged 9 commits into from
Oct 15, 2020

Conversation

mroeschke
Copy link
Member

  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • Create clearer separation for methods belonging to Window vs Rolling
  • More typing

@mroeschke mroeschke added Typing type annotations, mypy/pyright type checking Window rolling, ewma, expanding labels Oct 12, 2020
@mroeschke mroeschke added this to the 1.2 milestone Oct 12, 2020
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

small comment, cc @simonjayhawkins

pandas/core/window/expanding.py Show resolved Hide resolved
args=None,
kwargs=None,
args: Optional[Tuple] = None,
kwargs: Optional[Dict] = None,
Copy link
Member

Choose a reason for hiding this comment

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

we will eventually want to use disallow_any_generic as we increase strictness checks xref #30539

so for kwargs could probably use Dict[str, Any] and for args, Tuple[Any, ...]

can you also add type parameters to Callable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. Done

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @mroeschke lgtm

@@ -60,6 +64,15 @@ def get_center_of_mass(
return float(comass)


def wrap_result(obj: "Series", result: np.ndarray) -> "Series":
Copy link
Contributor

Choose a reason for hiding this comment

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

for clarify should make this wrap_result_1d, but can be in the future

@jreback jreback merged commit 020040b into pandas-dev:master Oct 15, 2020
@mroeschke mroeschke deleted the ref/window_methods_and_typing branch October 15, 2020 23:22
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Oct 26, 2020
kesmit13 pushed a commit to kesmit13/pandas that referenced this pull request Nov 2, 2020
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 Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants