Skip to content

CI: isort fixup on 1.1.x #37004

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 4 commits into from
Oct 9, 2020
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
14 changes: 11 additions & 3 deletions pandas/_libs/hashtable.pxd
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
from pandas._libs.khash cimport (
kh_int64_t, kh_uint64_t, kh_float64_t, kh_pymap_t, kh_str_t, uint64_t,
int64_t, float64_t)
from numpy cimport ndarray

from pandas._libs.khash cimport (
float64_t,
int64_t,
kh_float64_t,
kh_int64_t,
kh_pymap_t,
kh_str_t,
kh_uint64_t,
uint64_t,
)

# prototypes for sharing

cdef class HashTable:
Expand Down
3 changes: 2 additions & 1 deletion pandas/_libs/khash.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from cpython.object cimport PyObject
from numpy cimport int64_t, uint64_t, int32_t, uint32_t, float64_t
from numpy cimport float64_t, int32_t, int64_t, uint32_t, uint64_t


cdef extern from "khash_python.h":
ctypedef uint32_t khint_t
Expand Down
1 change: 1 addition & 0 deletions pandas/_libs/missing.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from numpy cimport ndarray, uint8_t


cpdef bint checknull(object val)
cpdef bint checknull_old(object val)
cpdef ndarray[uint8_t] isnaobj(ndarray arr)
Expand Down
3 changes: 1 addition & 2 deletions pandas/_libs/tslibs/ccalendar.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from cython cimport Py_ssize_t

from numpy cimport int64_t, int32_t
from numpy cimport int32_t, int64_t

ctypedef (int32_t, int32_t, int32_t) iso_calendar_t

Expand Down
3 changes: 1 addition & 2 deletions pandas/_libs/tslibs/conversion.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from cpython.datetime cimport datetime, tzinfo

from numpy cimport int64_t, int32_t, ndarray
from numpy cimport int32_t, int64_t, ndarray

from pandas._libs.tslibs.np_datetime cimport npy_datetimestruct

Expand Down
3 changes: 2 additions & 1 deletion pandas/_libs/tslibs/nattype.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from cpython.datetime cimport datetime

from numpy cimport int64_t


cdef int64_t NPY_NAT

cdef bint _nat_scalar_rules[6]
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/np_datetime.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from cpython.datetime cimport date, datetime
from numpy cimport int32_t, int64_t

from numpy cimport int64_t, int32_t

cdef extern from "numpy/ndarrayobject.h":
ctypedef int64_t npy_timedelta
Expand Down
1 change: 1 addition & 0 deletions pandas/_libs/tslibs/offsets.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from numpy cimport int64_t


cpdef to_offset(object obj)
cdef bint is_offset_object(object obj)
cdef bint is_tick_object(object obj)
Expand Down
1 change: 1 addition & 0 deletions pandas/_libs/tslibs/period.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ from numpy cimport int64_t

from .np_datetime cimport npy_datetimestruct


cdef bint is_period_object(object obj)
cdef int64_t get_period_ordinal(npy_datetimestruct *dts, int freq) nogil
1 change: 1 addition & 0 deletions pandas/_libs/tslibs/timedeltas.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from cpython.datetime cimport timedelta
from numpy cimport int64_t


# Exposed for tslib, not intended for outside use.
cpdef int64_t delta_to_nanoseconds(delta) except? -1
cdef convert_to_timedelta64(object ts, str unit)
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/timestamps.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from cpython.datetime cimport datetime, tzinfo

from numpy cimport int64_t

from pandas._libs.tslibs.base cimport ABCTimestamp
Expand Down
1 change: 1 addition & 0 deletions pandas/_libs/tslibs/timezones.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from cpython.datetime cimport datetime, timedelta, tzinfo


cdef tzinfo utc_pytz

cpdef bint is_utc(tzinfo tz)
Expand Down
4 changes: 3 additions & 1 deletion pandas/_libs/tslibs/util.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

from cpython.object cimport PyTypeObject


cdef extern from *:
"""
PyObject* char_to_string(const char* data) {
Expand All @@ -26,7 +27,8 @@ cdef extern from "Python.h":
const char* PyUnicode_AsUTF8AndSize(object obj,
Py_ssize_t* length) except NULL

from numpy cimport int64_t, float64_t
from numpy cimport float64_t, int64_t


cdef extern from "numpy/arrayobject.h":
PyTypeObject PyFloatingArrType_Type
Expand Down
5 changes: 3 additions & 2 deletions pandas/_libs/util.pxd
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pandas._libs.tslibs.util cimport *

cimport numpy as cnp
from numpy cimport ndarray

from pandas._libs.tslibs.util cimport *


cdef extern from "numpy/ndarraytypes.h":
void PyArray_CLEARFLAGS(ndarray arr, int flags) nogil

Expand Down
9 changes: 1 addition & 8 deletions pandas/tests/tseries/offsets/test_offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4441,14 +4441,7 @@ def test_week_add_invalid():


@pytest.mark.parametrize(
"attribute",
[
"hours",
"days",
"weeks",
"months",
"years",
],
"attribute", ["hours", "days", "weeks", "months", "years"],
)
def test_dateoffset_immutable(attribute):
offset = DateOffset(**{attribute: 0})
Expand Down