Skip to content

⬆️ UPGRADE: Autoupdate pre-commit config #50520

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

Merged
merged 3 commits into from
Jan 3, 2023
Merged
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ repos:
types_or: [python, rst, markdown]
additional_dependencies: [tomli]
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.9.1
rev: v0.10.1
hooks:
- id: cython-lint
- id: double-quote-cython-strings
Expand Down Expand Up @@ -77,12 +77,12 @@ repos:
- flake8-bugbear==22.7.1
- pandas-dev-flaker==0.5.0
- repo: https://github.com/pycqa/pylint
rev: v2.15.6
rev: v2.15.9
hooks:
- id: pylint
stages: [manual]
- repo: https://github.com/pycqa/pylint
rev: v2.15.6
rev: v2.15.9
hooks:
- id: pylint
alias: redefined-outer-name
Expand All @@ -99,11 +99,11 @@ repos:
args: [--disable=all, --enable=redefined-outer-name]
stages: [manual]
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.11.4
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand Down
53 changes: 25 additions & 28 deletions pandas/_libs/algos.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -647,40 +647,37 @@ def pad_2d_inplace(numeric_object_t[:, :] values, uint8_t[:, :] mask, limit=None
val = values[j, i]


"""
Backfilling logic for generating fill vector

Diagram of what's going on

Old New Fill vector Mask
. 0 1
. 0 1
. 0 1
A A 0 1
. 1 1
. 1 1
. 1 1
. 1 1
. 1 1
B B 1 1
. 2 1
. 2 1
. 2 1
C C 2 1
. 0
. 0
D
"""


@cython.boundscheck(False)
@cython.wraparound(False)
def backfill(
ndarray[numeric_object_t] old,
ndarray[numeric_object_t] new,
limit=None
) -> ndarray:
# -> ndarray[intp_t, ndim=1]
) -> ndarray: # -> ndarray[intp_t, ndim=1]
"""
Backfilling logic for generating fill vector

Diagram of what's going on

Old New Fill vector Mask
. 0 1
. 0 1
. 0 1
A A 0 1
. 1 1
. 1 1
. 1 1
. 1 1
. 1 1
B B 1 1
. 2 1
. 2 1
. 2 1
C C 2 1
. 0
. 0
D
"""
cdef:
Py_ssize_t i, j, nleft, nright
ndarray[intp_t, ndim=1] indexer
Expand Down
42 changes: 19 additions & 23 deletions pandas/_libs/tslibs/strptime.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
"""Strptime-related classes and functions.

TimeRE, _calc_julian_from_U_or_W are vendored
from the standard library, see
https://github.com/python/cpython/blob/main/Lib/_strptime.py
The original module-level docstring follows.

Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
strptime -- Calculates the time struct represented by the passed-in string
"""
from datetime import timezone

Expand All @@ -10,6 +24,11 @@ from cpython.datetime cimport (
timedelta,
tzinfo,
)
from _strptime import (
TimeRE as _TimeRE,
_getlang,
)
from _strptime import LocaleTime # no-cython-lint

import_datetime()

Expand Down Expand Up @@ -487,29 +506,6 @@ def array_strptime(
return result, result_timezone.base


"""
TimeRE, _calc_julian_from_U_or_W are vendored
from the standard library, see
https://github.com/python/cpython/blob/main/Lib/_strptime.py
The original module-level docstring follows.

Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
strptime -- Calculates the time struct represented by the passed-in string
"""

from _strptime import (
TimeRE as _TimeRE,
_getlang,
)
from _strptime import LocaleTime # no-cython-lint


class TimeRE(_TimeRE):
"""
Handle conversion from format directives to regexes.
Expand Down