diff --git a/pandas/_libs/tslibs/conversion.pyx b/pandas/_libs/tslibs/conversion.pyx index 57483783faf9f..a318bea14b52b 100644 --- a/pandas/_libs/tslibs/conversion.pyx +++ b/pandas/_libs/tslibs/conversion.pyx @@ -595,8 +595,12 @@ cdef inline void localize_tso(_TSObject obj, tzinfo tz): obj.tzinfo = tz -cdef inline bint _infer_tsobject_fold(_TSObject obj, ndarray[int64_t] trans, - int64_t[:] deltas, int32_t pos): +cdef inline bint _infer_tsobject_fold( + _TSObject obj, + const int64_t[:] trans, + const int64_t[:] deltas, + int32_t pos, +): """ Infer _TSObject fold property from value by assuming 0 and then setting to 1 if necessary. @@ -738,7 +742,7 @@ def normalize_i8_timestamps(int64_t[:] stamps, object tz): @cython.wraparound(False) @cython.boundscheck(False) -cdef int64_t[:] _normalize_local(int64_t[:] stamps, tzinfo tz): +cdef int64_t[:] _normalize_local(const int64_t[:] stamps, tzinfo tz): """ Normalize each of the (nanosecond) timestamps in the given array by rounding down to the beginning of the day (i.e. midnight) for the @@ -818,7 +822,7 @@ cdef inline int64_t _normalized_stamp(npy_datetimestruct *dts) nogil: @cython.wraparound(False) @cython.boundscheck(False) -def is_date_array_normalized(int64_t[:] stamps, object tz=None): +def is_date_array_normalized(const int64_t[:] stamps, object tz=None): """ Check if all of the given (nanosecond) timestamps are normalized to midnight, i.e. hour == minute == second == 0. If the optional timezone diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 0849ba0f29624..a66c9cd86d00c 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -609,8 +609,13 @@ cdef inline int month_add_months(npy_datetimestruct dts, int months) nogil: @cython.wraparound(False) @cython.boundscheck(False) -def shift_quarters(int64_t[:] dtindex, int quarters, - int q1start_month, object day, int modby=3): +def shift_quarters( + const int64_t[:] dtindex, + int quarters, + int q1start_month, + object day, + int modby=3, +): """ Given an int64 array representing nanosecond timestamps, shift all elements by the specified number of quarters using DateOffset semantics. @@ -759,7 +764,7 @@ def shift_quarters(int64_t[:] dtindex, int quarters, @cython.wraparound(False) @cython.boundscheck(False) -def shift_months(int64_t[:] dtindex, int months, object day=None): +def shift_months(const int64_t[:] dtindex, int months, object day=None): """ Given an int64-based datetime index, shift all elements specified number of months using DateOffset semantics diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 457f3eb0749c2..c31e8e3f7b4bb 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -101,7 +101,7 @@ _no_input = object() @cython.boundscheck(False) @cython.wraparound(False) -def ints_to_pytimedelta(int64_t[:] arr, box=False): +def ints_to_pytimedelta(const int64_t[:] arr, box=False): """ convert an i8 repr to an ndarray of timedelta or Timedelta (if box == True) diff --git a/pandas/_libs/tslibs/tzconversion.pyx b/pandas/_libs/tslibs/tzconversion.pyx index a9702f91107ec..6915783ac3aaa 100644 --- a/pandas/_libs/tslibs/tzconversion.pyx +++ b/pandas/_libs/tslibs/tzconversion.pyx @@ -549,8 +549,9 @@ cdef int64_t _tz_convert_tzlocal_fromutc(int64_t val, tzinfo tz, bint *fold): @cython.boundscheck(False) @cython.wraparound(False) -cdef int64_t[:] _tz_convert_dst(int64_t[:] values, tzinfo tz, - bint to_utc=True): +cdef int64_t[:] _tz_convert_dst( + const int64_t[:] values, tzinfo tz, bint to_utc=True, +): """ tz_convert for non-UTC non-tzlocal cases where we have to check DST transitions pointwise.