Skip to content

⬆️ UPGRADE: Autoupdate pre-commit config #41992

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
- id: absolufy-imports
files: ^pandas/
- repo: https://github.com/python/black
rev: 20.8b1
rev: 21.5b1
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
Expand Down Expand Up @@ -57,7 +57,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.18.3
rev: v2.19.0
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand Down
8 changes: 4 additions & 4 deletions pandas/_config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def get_default_val(pat: str):


class DictWrapper:
""" provide attribute-style access to a nested dict"""
"""provide attribute-style access to a nested dict"""

def __init__(self, d: dict[str, Any], prefix: str = ""):
object.__setattr__(self, "d", d)
Expand Down Expand Up @@ -571,7 +571,7 @@ def _get_root(key: str) -> tuple[dict[str, Any], str]:


def _is_deprecated(key: str) -> bool:
""" Returns True if the given option has been deprecated """
"""Returns True if the given option has been deprecated"""
key = key.lower()
return key in _deprecated_options

Expand Down Expand Up @@ -643,7 +643,7 @@ def _warn_if_deprecated(key: str) -> bool:


def _build_option_description(k: str) -> str:
""" Builds a formatted description of a registered option and prints it """
"""Builds a formatted description of a registered option and prints it"""
o = _get_registered_option(k)
d = _get_deprecated_option(k)

Expand All @@ -667,7 +667,7 @@ def _build_option_description(k: str) -> str:


def pp_options_list(keys: Iterable[str], width=80, _print: bool = False):
""" Builds a concise listing of available options, grouped by prefix """
"""Builds a concise listing of available options, grouped by prefix"""
from itertools import groupby
from textwrap import wrap

Expand Down
396 changes: 245 additions & 151 deletions pandas/_libs/algos.pyi

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions pandas/_libs/arrays.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,25 @@ from pandas._typing import (
class NDArrayBacked:
_dtype: DtypeObj
_ndarray: np.ndarray

def __init__(self, values: np.ndarray, dtype: DtypeObj): ...

@classmethod
def _simple_new(cls, values: np.ndarray, dtype: DtypeObj): ...

def _from_backing_data(self, values: np.ndarray): ...

def __setstate__(self, state): ...

def __len__(self) -> int: ...

@property
def shape(self) -> Shape: ...

@property
def ndim(self) -> int: ...

@property
def size(self) -> int: ...

@property
def nbytes(self) -> int: ...

def copy(self): ...
def delete(self, loc, axis=0): ...
def swapaxes(self, axis1, axis2): ...
def repeat(self, repeats: int | Sequence[int], axis: int | None = ...): ...
def reshape(self, *args, **kwargs): ...
def ravel(self, order="C"): ...

@property
def T(self): ...
115 changes: 47 additions & 68 deletions pandas/_libs/groupby.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,128 +3,111 @@ from typing import Literal
import numpy as np

def group_median_float64(
out: np.ndarray, # ndarray[float64_t, ndim=2]
counts: np.ndarray, # ndarray[int64_t]
values: np.ndarray, # ndarray[float64_t, ndim=2]
labels: np.ndarray, # ndarray[int64_t]
out: np.ndarray, # ndarray[float64_t, ndim=2]
counts: np.ndarray, # ndarray[int64_t]
values: np.ndarray, # ndarray[float64_t, ndim=2]
labels: np.ndarray, # ndarray[int64_t]
min_count: int = ..., # Py_ssize_t
) -> None: ...

def group_cumprod_float64(
out: np.ndarray, # float64_t[:, ::1]
out: np.ndarray, # float64_t[:, ::1]
values: np.ndarray, # const float64_t[:, :]
labels: np.ndarray, # const int64_t[:]
ngroups: int,
is_datetimelike: bool,
skipna: bool = ...,
) -> None: ...

def group_cumsum(
out: np.ndarray, # numeric[:, ::1]
out: np.ndarray, # numeric[:, ::1]
values: np.ndarray, # ndarray[numeric, ndim=2]
labels: np.ndarray, # const int64_t[:]
ngroups: int,
is_datetimelike: bool,
skipna: bool = ...,
) -> None: ...


def group_shift_indexer(
out: np.ndarray, # int64_t[::1]
out: np.ndarray, # int64_t[::1]
labels: np.ndarray, # const int64_t[:]
ngroups: int,
periods: int,
) -> None: ...


def group_fillna_indexer(
out: np.ndarray, # ndarray[int64_t]
out: np.ndarray, # ndarray[int64_t]
labels: np.ndarray, # ndarray[int64_t]
mask: np.ndarray, # ndarray[uint8_t]
mask: np.ndarray, # ndarray[uint8_t]
direction: Literal["ffill", "bfill"],
limit: int, # int64_t
limit: int, # int64_t
dropna: bool,
) -> None: ...


def group_any_all(
out: np.ndarray, # uint8_t[::1]
out: np.ndarray, # uint8_t[::1]
values: np.ndarray, # const uint8_t[::1]
labels: np.ndarray, # const int64_t[:]
mask: np.ndarray, # const uint8_t[::1]
mask: np.ndarray, # const uint8_t[::1]
val_test: Literal["any", "all"],
skipna: bool,
) -> None: ...

def group_add(
out: np.ndarray, # complexfloating_t[:, ::1]
out: np.ndarray, # complexfloating_t[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[complexfloating_t, ndim=2]
labels: np.ndarray, # const intp_t[:]
min_count: int = ...
min_count: int = ...,
) -> None: ...

def group_prod(
out: np.ndarray, # floating[:, ::1]
out: np.ndarray, # floating[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[floating, ndim=2]
labels: np.ndarray, # const intp_t[:]
min_count: int = ...
min_count: int = ...,
) -> None: ...

def group_var(
out: np.ndarray, # floating[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[floating, ndim=2]
labels: np.ndarray, # const intp_t[:]
out: np.ndarray, # floating[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[floating, ndim=2]
labels: np.ndarray, # const intp_t[:]
min_count: int = ..., # Py_ssize_t
ddof: int = ..., # int64_t
ddof: int = ..., # int64_t
) -> None: ...

def group_mean(
out: np.ndarray, # floating[:, ::1]
out: np.ndarray, # floating[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[floating, ndim=2]
labels: np.ndarray, # const intp_t[:]
min_count: int = ...
min_count: int = ...,
) -> None: ...

def group_ohlc(
out: np.ndarray, # floating[:, ::1]
out: np.ndarray, # floating[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[floating, ndim=2]
labels: np.ndarray, # const intp_t[:]
min_count: int = ...
min_count: int = ...,
) -> None: ...

def group_quantile(
out: np.ndarray, # ndarray[float64_t]
out: np.ndarray, # ndarray[float64_t]
values: np.ndarray, # ndarray[numeric, ndim=1]
labels: np.ndarray, # ndarray[int64_t]
mask: np.ndarray, # ndarray[uint8_t]
q: float, # float64_t
mask: np.ndarray, # ndarray[uint8_t]
q: float, # float64_t
interpolation: Literal["linear", "lower", "higher", "nearest", "midpoint"],
) -> None: ...

def group_last(
out: np.ndarray, # rank_t[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[rank_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
out: np.ndarray, # rank_t[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[rank_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
min_count: int = ..., # Py_ssize_t
) -> None: ...

def group_nth(
out: np.ndarray, # rank_t[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[rank_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
min_count: int = ..., # int64_t
rank: int = ..., # int64_t
out: np.ndarray, # rank_t[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[rank_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
min_count: int = ..., # int64_t
rank: int = ..., # int64_t
) -> None: ...

def group_rank(
out: np.ndarray, # float64_t[:, ::1]
out: np.ndarray, # float64_t[:, ::1]
values: np.ndarray, # ndarray[rank_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
ngroups: int,
Expand All @@ -134,35 +117,31 @@ def group_rank(
pct: bool = ...,
na_option: Literal["keep", "top", "bottom"] = ...,
) -> None: ...

def group_max(
out: np.ndarray, # groupby_t[:, ::1]
out: np.ndarray, # groupby_t[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[groupby_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
min_count: int = ...,
) -> None: ...

def group_min(
out: np.ndarray, # groupby_t[:, ::1]
out: np.ndarray, # groupby_t[:, ::1]
counts: np.ndarray, # int64_t[::1]
values: np.ndarray, # ndarray[groupby_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
min_count: int = ...,
) -> None: ...

def group_cummin(
out: np.ndarray, # groupby_t[:, ::1]
values: np.ndarray, # ndarray[groupby_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
out: np.ndarray, # groupby_t[:, ::1]
values: np.ndarray, # ndarray[groupby_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
ngroups: int,
is_datetimelike: bool,
) -> None: ...

def group_cummax(
out: np.ndarray, # groupby_t[:, ::1]
values: np.ndarray, # ndarray[groupby_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
out: np.ndarray, # groupby_t[:, ::1]
values: np.ndarray, # ndarray[groupby_t, ndim=2]
labels: np.ndarray, # const int64_t[:]
ngroups: int,
is_datetimelike: bool,
) -> None: ...
Loading