Skip to content

CLN: period boundscheck warnings #11404

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 1 commit into from
Oct 24, 2015
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
5 changes: 5 additions & 0 deletions pandas/src/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ from pandas import compat
from pandas.tseries import offsets
from pandas.tseries.tools import parse_time_string

cimport cython
from datetime cimport *
cimport util
cimport lib
Expand Down Expand Up @@ -124,6 +125,8 @@ cdef inline int64_t remove_mult(int64_t period_ord_w_mult, int64_t mult):

return period_ord_w_mult * mult + 1;

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

@cython.wraparound(False)
@cython.boundscheck(False)
def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq):
"""
Convert array to datetime64 values from a set of ordinals corresponding to
Expand Down
2 changes: 1 addition & 1 deletion pandas/tslib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4431,7 +4431,7 @@ def shift_months(int64_t[:] dtindex, int months, object day=None):
Py_ssize_t i
pandas_datetimestruct dts
int count = len(dtindex)
cdef int days_in_current_month
int days_in_current_month
int64_t[:] out = np.empty(count, dtype='int64')

if day is None:
Expand Down