Skip to content

Commit ae6925c

Browse files
committed
CLN: period boundscheck warnings
1 parent 22d75a3 commit ae6925c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pandas/src/period.pyx

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ from pandas import compat
2020
from pandas.tseries import offsets
2121
from pandas.tseries.tools import parse_time_string
2222

23+
cimport cython
2324
from datetime cimport *
2425
cimport util
2526
cimport lib
@@ -124,6 +125,8 @@ cdef inline int64_t remove_mult(int64_t period_ord_w_mult, int64_t mult):
124125

125126
return period_ord_w_mult * mult + 1;
126127

128+
@cython.wraparound(False)
129+
@cython.boundscheck(False)
127130
def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None):
128131
"""
129132
Convert array of datetime64 values (passed in as 'i8' dtype) to a set of
@@ -151,6 +154,8 @@ def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None):
151154
out = localize_dt64arr_to_period(dtarr, freq, tz)
152155
return out
153156

157+
@cython.wraparound(False)
158+
@cython.boundscheck(False)
154159
def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq):
155160
"""
156161
Convert array to datetime64 values from a set of ordinals corresponding to

pandas/tslib.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4431,7 +4431,7 @@ def shift_months(int64_t[:] dtindex, int months, object day=None):
44314431
Py_ssize_t i
44324432
pandas_datetimestruct dts
44334433
int count = len(dtindex)
4434-
cdef int days_in_current_month
4434+
int days_in_current_month
44354435
int64_t[:] out = np.empty(count, dtype='int64')
44364436

44374437
if day is None:

0 commit comments

Comments
 (0)