Skip to content

Commit 79e5fc0

Browse files
TazminiaTomAugspurgerMarcoGorelli
authored and
Kevin D Smith
committed
CI Upgrade isort in pre-commit (pandas-dev#36978)
* fixes issue pandas-dev#36879 * Fixup * sort pxd files Co-authored-by: Tom Augspurger <[email protected]> Co-authored-by: Marco Gorelli <[email protected]>
1 parent 3a8def4 commit 79e5fc0

15 files changed

+32
-15
lines changed

.pre-commit-config.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ repos:
2121
- file
2222
args: [--append-config=flake8/cython-template.cfg]
2323
- repo: https://github.com/PyCQA/isort
24-
rev: 5.2.2
24+
rev: 5.6.0
2525
hooks:
2626
- id: isort
2727
exclude: ^pandas/__init__\.py$|^pandas/core/api\.py$
28+
files: '.pxd$|.py$'
29+
types: [file]
2830
- repo: https://github.com/asottile/pyupgrade
2931
rev: v2.7.2
3032
hooks:

pandas/_libs/hashtable.pxd

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
from numpy cimport intp_t, ndarray
2+
13
from pandas._libs.khash cimport (
2-
kh_int64_t, kh_uint64_t, kh_float64_t, kh_pymap_t, kh_str_t, uint64_t,
3-
int64_t, float64_t)
4-
from numpy cimport ndarray, intp_t
4+
float64_t,
5+
int64_t,
6+
kh_float64_t,
7+
kh_int64_t,
8+
kh_pymap_t,
9+
kh_str_t,
10+
kh_uint64_t,
11+
uint64_t,
12+
)
513

614
# prototypes for sharing
715

pandas/_libs/khash.pxd

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from cpython.object cimport PyObject
2-
from numpy cimport int64_t, uint64_t, int32_t, uint32_t, float64_t
2+
from numpy cimport float64_t, int32_t, int64_t, uint32_t, uint64_t
3+
34

45
cdef extern from "khash_python.h":
56
ctypedef uint32_t khint_t

pandas/_libs/missing.pxd

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from numpy cimport ndarray, uint8_t
22

3+
34
cpdef bint checknull(object val)
45
cpdef bint checknull_old(object val)
56
cpdef ndarray[uint8_t] isnaobj(ndarray arr)

pandas/_libs/tslibs/ccalendar.pxd

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from cython cimport Py_ssize_t
2-
3-
from numpy cimport int64_t, int32_t
2+
from numpy cimport int32_t, int64_t
43

54
ctypedef (int32_t, int32_t, int32_t) iso_calendar_t
65

pandas/_libs/tslibs/conversion.pxd

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from cpython.datetime cimport datetime, tzinfo
2-
3-
from numpy cimport int64_t, int32_t, ndarray
2+
from numpy cimport int32_t, int64_t, ndarray
43

54
from pandas._libs.tslibs.np_datetime cimport npy_datetimestruct
65

pandas/_libs/tslibs/nattype.pxd

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from cpython.datetime cimport datetime
2-
32
from numpy cimport int64_t
3+
4+
45
cdef int64_t NPY_NAT
56

67
cdef bint _nat_scalar_rules[6]

pandas/_libs/tslibs/np_datetime.pxd

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from cpython.datetime cimport date, datetime
2+
from numpy cimport int32_t, int64_t
23

3-
from numpy cimport int64_t, int32_t
44

55
cdef extern from "numpy/ndarrayobject.h":
66
ctypedef int64_t npy_timedelta

pandas/_libs/tslibs/offsets.pxd

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from numpy cimport int64_t
22

3+
34
cpdef to_offset(object obj)
45
cdef bint is_offset_object(object obj)
56
cdef bint is_tick_object(object obj)

pandas/_libs/tslibs/period.pxd

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ from numpy cimport int64_t
22

33
from .np_datetime cimport npy_datetimestruct
44

5+
56
cdef bint is_period_object(object obj)
67
cdef int64_t get_period_ordinal(npy_datetimestruct *dts, int freq) nogil

pandas/_libs/tslibs/timedeltas.pxd

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from cpython.datetime cimport timedelta
22
from numpy cimport int64_t
33

4+
45
# Exposed for tslib, not intended for outside use.
56
cpdef int64_t delta_to_nanoseconds(delta) except? -1
67
cdef convert_to_timedelta64(object ts, str unit)

pandas/_libs/tslibs/timestamps.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from cpython.datetime cimport datetime, tzinfo
2-
32
from numpy cimport int64_t
43

54
from pandas._libs.tslibs.base cimport ABCTimestamp

pandas/_libs/tslibs/timezones.pxd

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from cpython.datetime cimport datetime, timedelta, tzinfo
22

3+
34
cdef tzinfo utc_pytz
45

56
cpdef bint is_utc(tzinfo tz)

pandas/_libs/tslibs/util.pxd

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
from cpython.object cimport PyTypeObject
33

4+
45
cdef extern from *:
56
"""
67
PyObject* char_to_string(const char* data) {
@@ -26,7 +27,8 @@ cdef extern from "Python.h":
2627
const char* PyUnicode_AsUTF8AndSize(object obj,
2728
Py_ssize_t* length) except NULL
2829

29-
from numpy cimport int64_t, float64_t
30+
from numpy cimport float64_t, int64_t
31+
3032

3133
cdef extern from "numpy/arrayobject.h":
3234
PyTypeObject PyFloatingArrType_Type

pandas/_libs/util.pxd

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
from pandas._libs.tslibs.util cimport *
2-
31
cimport numpy as cnp
42
from numpy cimport ndarray
53

4+
from pandas._libs.tslibs.util cimport *
5+
6+
67
cdef extern from "numpy/ndarraytypes.h":
78
void PyArray_CLEARFLAGS(ndarray arr, int flags) nogil
89

0 commit comments

Comments
 (0)