@@ -219,7 +219,9 @@ cdef _wrap_timedelta_result(result):
219
219
220
220
221
221
cdef _get_calendar(weekmask, holidays, calendar):
222
- """ Generate busdaycalendar"""
222
+ """
223
+ Generate busdaycalendar
224
+ """
223
225
if isinstance (calendar, np.busdaycalendar):
224
226
if not holidays:
225
227
holidays = tuple (calendar.holidays)
@@ -659,14 +661,18 @@ cdef class BaseOffset:
659
661
return nint
660
662
661
663
def __setstate__ (self , state ):
662
- """ Reconstruct an instance from a pickled state"""
664
+ """
665
+ Reconstruct an instance from a pickled state
666
+ """
663
667
self .n = state.pop(" n" )
664
668
self .normalize = state.pop(" normalize" )
665
669
self ._cache = state.pop(" _cache" , {})
666
670
# At this point we expect state to be empty
667
671
668
672
def __getstate__ (self ):
669
- """ Return a pickleable state"""
673
+ """
674
+ Return a pickleable state
675
+ """
670
676
state = {}
671
677
state[" n" ] = self .n
672
678
state[" normalize" ] = self .normalize
@@ -971,7 +977,9 @@ cdef class RelativeDeltaOffset(BaseOffset):
971
977
object .__setattr__ (self , key, val)
972
978
973
979
def __getstate__ (self ):
974
- """ Return a pickleable state"""
980
+ """
981
+ Return a pickleable state
982
+ """
975
983
# RelativeDeltaOffset (technically DateOffset) is the only non-cdef
976
984
# class, so the only one with __dict__
977
985
state = self .__dict__ .copy()
@@ -980,7 +988,9 @@ cdef class RelativeDeltaOffset(BaseOffset):
980
988
return state
981
989
982
990
def __setstate__ (self , state ):
983
- """ Reconstruct an instance from a pickled state"""
991
+ """
992
+ Reconstruct an instance from a pickled state
993
+ """
984
994
985
995
if " offset" in state:
986
996
# Older (<0.22.0) versions have offset attribute instead of _offset
@@ -3604,7 +3614,9 @@ def shift_day(other: datetime, days: int) -> datetime:
3604
3614
3605
3615
3606
3616
cdef inline int year_add_months(npy_datetimestruct dts , int months ) nogil:
3607
- """new year number after shifting npy_datetimestruct number of months"""
3617
+ """
3618
+ New year number after shifting npy_datetimestruct number of months.
3619
+ """
3608
3620
return dts.year + (dts.month + months - 1) // 12
3609
3621
3610
3622
@@ -3702,7 +3714,9 @@ cdef inline void _shift_months(const int64_t[:] dtindex,
3702
3714
Py_ssize_t count,
3703
3715
int months,
3704
3716
str day_opt) nogil:
3705
- """ See shift_months.__doc__"""
3717
+ """
3718
+ See shift_months.__doc__
3719
+ """
3706
3720
cdef:
3707
3721
Py_ssize_t i
3708
3722
int months_to_roll
@@ -3734,7 +3748,9 @@ cdef inline void _shift_quarters(const int64_t[:] dtindex,
3734
3748
int q1start_month,
3735
3749
str day_opt,
3736
3750
int modby) nogil:
3737
- """ See shift_quarters.__doc__"""
3751
+ """
3752
+ See shift_quarters.__doc__
3753
+ """
3738
3754
cdef:
3739
3755
Py_ssize_t i
3740
3756
int months_since, n
@@ -3990,7 +4006,9 @@ cdef inline int _roll_qtrday(npy_datetimestruct* dts,
3990
4006
int n ,
3991
4007
int months_since ,
3992
4008
str day_opt ) nogil except? -1:
3993
- """See roll_qtrday.__doc__"""
4009
+ """
4010
+ See roll_qtrday.__doc__
4011
+ """
3994
4012
3995
4013
if n > 0:
3996
4014
if months_since < 0 or (months_since == 0 and
0 commit comments