diff --git a/pandas/_libs/hashtable.pyx b/pandas/_libs/hashtable.pyx index 9aeb700dd5923..b6b81055f89b2 100644 --- a/pandas/_libs/hashtable.pyx +++ b/pandas/_libs/hashtable.pyx @@ -50,12 +50,6 @@ cnp.import_ufunc() cdef int64_t iNaT = util.get_nat() _SIZE_HINT_LIMIT = (1 << 20) + 7 -cdef extern from "datetime.h": - bint PyDateTime_Check(object o) - void PyDateTime_IMPORT() - -PyDateTime_IMPORT - cdef size_t _INIT_VEC_CAP = 128 diff --git a/pandas/_libs/lib.pyx b/pandas/_libs/lib.pyx index 503badd0ca8bc..e7e92b7ae987a 100644 --- a/pandas/_libs/lib.pyx +++ b/pandas/_libs/lib.pyx @@ -48,7 +48,6 @@ cdef double NAN = nan # this is our tseries.pxd from datetime cimport ( get_timedelta64_value, get_datetime64_value, - npy_timedelta, npy_datetime, PyDateTime_Check, PyDate_Check, PyTime_Check, PyDelta_Check, PyDateTime_IMPORT) @@ -62,11 +61,8 @@ from interval import Interval cdef int64_t NPY_NAT = util.get_nat() -ctypedef unsigned char UChar - cimport util -from util cimport (is_array, _checknull, _checknan, INT64_MAX, - INT64_MIN, UINT8_MAX) +from util cimport is_array, _checknull, _checknan cdef extern from "math.h": double sqrt(double x) diff --git a/pandas/_libs/period.pyx b/pandas/_libs/period.pyx index 725da22104efc..7760df5144117 100644 --- a/pandas/_libs/period.pyx +++ b/pandas/_libs/period.pyx @@ -7,8 +7,7 @@ from cpython cimport ( PyObject_RichCompareBool, Py_EQ, Py_NE) -from numpy cimport (int8_t, int32_t, int64_t, import_array, ndarray, - NPY_INT64, NPY_DATETIME, NPY_TIMEDELTA) +from numpy cimport int64_t, import_array, ndarray import numpy as np import_array() @@ -23,12 +22,11 @@ from datetime cimport ( pandas_datetimestruct, pandas_datetimestruct_to_datetime, pandas_datetime_to_datetimestruct, - PANDAS_FR_ns, - INT32_MIN) + PANDAS_FR_ns) cimport util -from util cimport is_period_object, is_string_object +from util cimport is_period_object, is_string_object, INT32_MIN from lib cimport is_null_datetimelike from pandas._libs import tslib @@ -90,12 +88,8 @@ cdef extern from "period_helper.h": int microseconds, int picoseconds, int freq) nogil except INT32_MIN - int64_t get_python_ordinal(int64_t period_ordinal, - int freq) except INT32_MIN - int get_date_info(int64_t ordinal, int freq, date_info *dinfo) nogil except INT32_MIN - double getAbsTime(int, int64_t, int64_t) int pyear(int64_t ordinal, int freq) except INT32_MIN int pqyear(int64_t ordinal, int freq) except INT32_MIN diff --git a/pandas/_libs/tslib.pyx b/pandas/_libs/tslib.pyx index ff20ea287bd9d..745632cf3d719 100644 --- a/pandas/_libs/tslib.pyx +++ b/pandas/_libs/tslib.pyx @@ -21,7 +21,6 @@ from cpython cimport ( cdef extern from "Python.h": cdef PyTypeObject *Py_TYPE(object) -# this is our datetime.pxd from libc.stdlib cimport free from util cimport (is_integer_object, is_float_object, is_datetime64_object, @@ -65,11 +64,8 @@ from .tslibs.parsing import parse_datetime_string cimport cython -import time - from pandas.compat import iteritems, callable -import operator import collections import warnings @@ -933,10 +929,6 @@ cdef int64_t _NS_UPPER_BOUND = INT64_MAX # use the smallest value with a 0 nanosecond unit (0s in last 3 digits) cdef int64_t _NS_LOWER_BOUND = -9223372036854775000 -cdef pandas_datetimestruct _NS_MIN_DTS, _NS_MAX_DTS -pandas_datetime_to_datetimestruct(_NS_LOWER_BOUND, PANDAS_FR_ns, &_NS_MIN_DTS) -pandas_datetime_to_datetimestruct(_NS_UPPER_BOUND, PANDAS_FR_ns, &_NS_MAX_DTS) - # Resolution is in nanoseconds Timestamp.min = Timestamp(_NS_LOWER_BOUND) Timestamp.max = Timestamp(_NS_UPPER_BOUND)