@@ -1910,7 +1910,7 @@ cdef class WeekOfMonthMixin(SingleConstructorOffset):
19101910
19111911 shifted = shift_month(other, months, " start" )
19121912 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 )
19141914
19151915 def is_on_offset(self , dt: datetime ) -> bool:
19161916 if self.normalize and not _is_normalized(dt ):
@@ -3132,7 +3132,7 @@ cdef class FY5253Quarter(FY5253Mixin):
31323132 qtr_lens = self .get_weeks(norm)
31333133
31343134 # 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))
31363136 assert self ._offset.is_on_offset(end), (start, end, qtr_lens)
31373137
31383138 tdelta = norm - start
@@ -3173,7 +3173,7 @@ cdef class FY5253Quarter(FY5253Mixin):
31733173 # Note: we always have 0 <= n < 4
31743174 weeks = sum (qtr_lens[:n])
31753175 if weeks:
3176- res = shift_day (res, days = weeks * 7 )
3176+ res = _shift_day (res, days = weeks * 7 )
31773177
31783178 return res
31793179
@@ -3210,7 +3210,7 @@ cdef class FY5253Quarter(FY5253Mixin):
32103210
32113211 current = next_year_end
32123212 for qtr_len in qtr_lens:
3213- current = shift_day (current, days = qtr_len * 7 )
3213+ current = _shift_day (current, days = qtr_len * 7 )
32143214 if dt == current:
32153215 return True
32163216 return False
@@ -3729,7 +3729,7 @@ cpdef to_offset(freq):
37293729# ----------------------------------------------------------------------
37303730# RelativeDelta Arithmetic
37313731
3732- def shift_day (other: datetime , days: int ) -> datetime :
3732+ cdef datetime _shift_day( datetime other, int days) :
37333733 """
37343734 Increment the datetime `other` by the given number of days, retaining
37353735 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,
39153915 out[i] = dtstruct_to_dt64(& dts)
39163916
39173917
3918+ @ cython.wraparound (False )
3919+ @ cython.boundscheck (False )
39183920cdef ndarray[int64_t] _shift_bdays(const int64_t[:] i8other, int periods):
39193921 """
39203922 Implementation of BusinessDay.apply_offset.
0 commit comments