@@ -1910,7 +1910,7 @@ cdef class WeekOfMonthMixin(SingleConstructorOffset):
1910
1910
1911
1911
shifted = shift_month(other, months, " start" )
1912
1912
to_day = self ._get_offset_day(shifted)
1913
- return shift_day (shifted , to_day - shifted.day )
1913
+ return _shift_day (shifted , to_day - shifted.day )
1914
1914
1915
1915
def is_on_offset(self , dt: datetime ) -> bool:
1916
1916
if self.normalize and not _is_normalized(dt ):
@@ -3132,7 +3132,7 @@ cdef class FY5253Quarter(FY5253Mixin):
3132
3132
qtr_lens = self .get_weeks(norm)
3133
3133
3134
3134
# check that qtr_lens is consistent with self._offset addition
3135
- end = shift_day (start, days = 7 * sum (qtr_lens))
3135
+ end = _shift_day (start, days = 7 * sum (qtr_lens))
3136
3136
assert self ._offset.is_on_offset(end), (start, end, qtr_lens)
3137
3137
3138
3138
tdelta = norm - start
@@ -3173,7 +3173,7 @@ cdef class FY5253Quarter(FY5253Mixin):
3173
3173
# Note: we always have 0 <= n < 4
3174
3174
weeks = sum (qtr_lens[:n])
3175
3175
if weeks:
3176
- res = shift_day (res, days = weeks * 7 )
3176
+ res = _shift_day (res, days = weeks * 7 )
3177
3177
3178
3178
return res
3179
3179
@@ -3210,7 +3210,7 @@ cdef class FY5253Quarter(FY5253Mixin):
3210
3210
3211
3211
current = next_year_end
3212
3212
for qtr_len in qtr_lens:
3213
- current = shift_day (current, days = qtr_len * 7 )
3213
+ current = _shift_day (current, days = qtr_len * 7 )
3214
3214
if dt == current:
3215
3215
return True
3216
3216
return False
@@ -3729,7 +3729,7 @@ cpdef to_offset(freq):
3729
3729
# ----------------------------------------------------------------------
3730
3730
# RelativeDelta Arithmetic
3731
3731
3732
- def shift_day (other: datetime , days: int ) -> datetime :
3732
+ cdef datetime _shift_day( datetime other, int days) :
3733
3733
"""
3734
3734
Increment the datetime `other` by the given number of days, retaining
3735
3735
the time-portion of the datetime. For tz-naive datetimes this is
@@ -3915,6 +3915,8 @@ cdef inline void _shift_quarters(const int64_t[:] dtindex,
3915
3915
out[i] = dtstruct_to_dt64(& dts)
3916
3916
3917
3917
3918
+ @ cython.wraparound (False )
3919
+ @ cython.boundscheck (False )
3918
3920
cdef ndarray[int64_t] _shift_bdays(const int64_t[:] i8other, int periods):
3919
3921
"""
3920
3922
Implementation of BusinessDay.apply_offset.
0 commit comments