Skip to content

Commit 242d8de

Browse files
committed
docstring fixups, closes pandas-dev#26982
1 parent 5b5cfb2 commit 242d8de

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

pandas/_libs/tslibs/offsets.pyx

+27-9
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ cdef _wrap_timedelta_result(result):
219219

220220

221221
cdef _get_calendar(weekmask, holidays, calendar):
222-
"""Generate busdaycalendar"""
222+
"""
223+
Generate busdaycalendar
224+
"""
223225
if isinstance(calendar, np.busdaycalendar):
224226
if not holidays:
225227
holidays = tuple(calendar.holidays)
@@ -659,14 +661,18 @@ cdef class BaseOffset:
659661
return nint
660662

661663
def __setstate__(self, state):
662-
"""Reconstruct an instance from a pickled state"""
664+
"""
665+
Reconstruct an instance from a pickled state
666+
"""
663667
self.n = state.pop("n")
664668
self.normalize = state.pop("normalize")
665669
self._cache = state.pop("_cache", {})
666670
# At this point we expect state to be empty
667671

668672
def __getstate__(self):
669-
"""Return a pickleable state"""
673+
"""
674+
Return a pickleable state
675+
"""
670676
state = {}
671677
state["n"] = self.n
672678
state["normalize"] = self.normalize
@@ -971,7 +977,9 @@ cdef class RelativeDeltaOffset(BaseOffset):
971977
object.__setattr__(self, key, val)
972978

973979
def __getstate__(self):
974-
"""Return a pickleable state"""
980+
"""
981+
Return a pickleable state
982+
"""
975983
# RelativeDeltaOffset (technically DateOffset) is the only non-cdef
976984
# class, so the only one with __dict__
977985
state = self.__dict__.copy()
@@ -980,7 +988,9 @@ cdef class RelativeDeltaOffset(BaseOffset):
980988
return state
981989

982990
def __setstate__(self, state):
983-
"""Reconstruct an instance from a pickled state"""
991+
"""
992+
Reconstruct an instance from a pickled state
993+
"""
984994

985995
if "offset" in state:
986996
# Older (<0.22.0) versions have offset attribute instead of _offset
@@ -3604,7 +3614,9 @@ def shift_day(other: datetime, days: int) -> datetime:
36043614

36053615

36063616
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+
"""
36083620
return dts.year + (dts.month + months - 1) // 12
36093621

36103622

@@ -3702,7 +3714,9 @@ cdef inline void _shift_months(const int64_t[:] dtindex,
37023714
Py_ssize_t count,
37033715
int months,
37043716
str day_opt) nogil:
3705-
"""See shift_months.__doc__"""
3717+
"""
3718+
See shift_months.__doc__
3719+
"""
37063720
cdef:
37073721
Py_ssize_t i
37083722
int months_to_roll
@@ -3734,7 +3748,9 @@ cdef inline void _shift_quarters(const int64_t[:] dtindex,
37343748
int q1start_month,
37353749
str day_opt,
37363750
int modby) nogil:
3737-
"""See shift_quarters.__doc__"""
3751+
"""
3752+
See shift_quarters.__doc__
3753+
"""
37383754
cdef:
37393755
Py_ssize_t i
37403756
int months_since, n
@@ -3990,7 +4006,9 @@ cdef inline int _roll_qtrday(npy_datetimestruct* dts,
39904006
int n,
39914007
int months_since,
39924008
str day_opt) nogil except? -1:
3993-
"""See roll_qtrday.__doc__"""
4009+
"""
4010+
See roll_qtrday.__doc__
4011+
"""
39944012

39954013
if n > 0:
39964014
if months_since < 0 or (months_since == 0 and

0 commit comments

Comments
 (0)