Skip to content

Commit 5633f8d

Browse files
committed
Indented See Also strings to avoid using # noqa
1 parent 72b141f commit 5633f8d

File tree

1 file changed

+47
-27
lines changed

1 file changed

+47
-27
lines changed

pandas/_libs/tslibs/offsets.pyx

+47-27
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,10 @@ cdef class BaseOffset:
600600

601601
See Also
602602
--------
603-
tseries.offsets.Hour.rule_code : Returns a string representing the base frequency of 'h'.
604-
tseries.offsets.Day.rule_code : Returns a string representing the base frequency of 'D'.
603+
tseries.offsets.Hour.rule_code :
604+
Returns a string representing the base frequency of 'h'.
605+
tseries.offsets.Day.rule_code :
606+
Returns a string representing the base frequency of 'D'.
605607

606608
Examples
607609
--------
@@ -610,7 +612,7 @@ cdef class BaseOffset:
610612

611613
>>> pd.offsets.Week(5).rule_code
612614
'W'
613-
""" # noqa
615+
"""
614616
return self._prefix
615617

616618
@cache_readonly
@@ -620,10 +622,14 @@ cdef class BaseOffset:
620622

621623
See Also
622624
--------
623-
tseries.offsets.BusinessDay.freqstr : Return a string representing an offset frequency in Business Days.
624-
tseries.offsets.BusinessHour.freqstr : Return a string representing an offset frequency in Business Hours.
625-
tseries.offsets.Week.freqstr : Return a string representing an offset frequency in Weeks.
626-
tseries.offsets.Hour.freqstr : Return a string representing an offset frequency in Hours.
625+
tseries.offsets.BusinessDay.freqstr :
626+
Return a string representing an offset frequency in Business Days.
627+
tseries.offsets.BusinessHour.freqstr :
628+
Return a string representing an offset frequency in Business Hours.
629+
tseries.offsets.Week.freqstr :
630+
Return a string representing an offset frequency in Weeks.
631+
tseries.offsets.Hour.freqstr :
632+
Return a string representing an offset frequency in Hours.
627633

628634
Examples
629635
--------
@@ -638,7 +644,7 @@ cdef class BaseOffset:
638644

639645
>>> pd.offsets.Nano(-3).freqstr
640646
'-3ns'
641-
""" # noqa
647+
"""
642648
try:
643649
code = self.rule_code
644650
except NotImplementedError:
@@ -812,16 +818,20 @@ cdef class BaseOffset:
812818
813819
See Also
814820
--------
815-
tseries.offsets.WeekOfMonth.nanos : Raises a ValueError because the frequency is non-fixed.
816-
tseries.offsets.YearBegin.nanos : Raises a ValueError because the frequency is non-fixed.
817-
tseries.offsets.Hour.nanos : Returns an integer of the total number of nanoseconds.
818-
tseries.offsets.Day.nanos : Returns an integer of the total number of nanoseconds.
821+
tseries.offsets.WeekOfMonth.nanos :
822+
Raises a ValueError because the frequency is non-fixed.
823+
tseries.offsets.YearBegin.nanos :
824+
Raises a ValueError because the frequency is non-fixed.
825+
tseries.offsets.Hour.nanos :
826+
Returns an integer of the total number of nanoseconds.
827+
tseries.offsets.Day.nanos :
828+
Returns an integer of the total number of nanoseconds.
819829
820830
Examples
821831
--------
822832
>>> pd.offsets.Week(n=1).nanos
823833
ValueError: Week: weekday=None is a non-fixed frequency
824-
""" # noqa
834+
"""
825835
raise ValueError(f"{self} is a non-fixed frequency")
826836

827837
# ------------------------------------------------------------------
@@ -1033,16 +1043,20 @@ cdef class Tick(SingleConstructorOffset):
10331043

10341044
See Also
10351045
--------
1036-
tseries.offsets.Hour.nanos : Returns an integer of the total number of nanoseconds.
1037-
tseries.offsets.Day.nanos : Returns an integer of the total number of nanoseconds.
1038-
tseries.offsets.WeekOfMonth.nanos : Raises a ValueError because the frequency is non-fixed.
1039-
tseries.offsets.YearBegin.nanos : Raises a ValueError because the frequency is non-fixed.
1046+
tseries.offsets.Hour.nanos :
1047+
Returns an integer of the total number of nanoseconds.
1048+
tseries.offsets.Day.nanos :
1049+
Returns an integer of the total number of nanoseconds.
1050+
tseries.offsets.WeekOfMonth.nanos :
1051+
Raises a ValueError because the frequency is non-fixed.
1052+
tseries.offsets.YearBegin.nanos :
1053+
Raises a ValueError because the frequency is non-fixed.
10401054

10411055
Examples
10421056
--------
10431057
>>> pd.offsets.Hour(5).nanos
10441058
18000000000000
1045-
""" # noqa
1059+
"""
10461060
return self.n * self._nanos_inc
10471061

10481062
def is_on_offset(self, dt: datetime) -> bool:
@@ -2476,8 +2490,10 @@ cdef class WeekOfMonthMixin(SingleConstructorOffset):
24762490

24772491
See Also
24782492
--------
2479-
tseries.offsets.Hour.rule_code : Returns a string representing the base frequency of 'h'.
2480-
tseries.offsets.Day.rule_code : Returns a string representing the base frequency of 'D'.
2493+
tseries.offsets.Hour.rule_code :
2494+
Returns a string representing the base frequency of 'h'.
2495+
tseries.offsets.Day.rule_code :
2496+
Returns a string representing the base frequency of 'D'.
24812497

24822498
Examples
24832499
--------
@@ -2486,7 +2502,7 @@ cdef class WeekOfMonthMixin(SingleConstructorOffset):
24862502

24872503
>>> pd.offsets.WeekOfMonth(n=1, week=0, weekday=0).rule_code
24882504
'WOM-1MON'
2489-
""" # noqa
2505+
"""
24902506
weekday = int_to_weekday.get(self.weekday, "")
24912507
if self.week == -1:
24922508
# LastWeekOfMonth
@@ -2538,8 +2554,10 @@ cdef class YearOffset(SingleConstructorOffset):
25382554

25392555
See Also
25402556
--------
2541-
tseries.offsets.Hour.rule_code : Returns a string representing the base frequency of 'h'.
2542-
tseries.offsets.Day.rule_code : Returns a string representing the base frequency of 'D'.
2557+
tseries.offsets.Hour.rule_code :
2558+
Returns a string representing the base frequency of 'h'.
2559+
tseries.offsets.Day.rule_code :
2560+
Returns a string representing the base frequency of 'D'.
25432561

25442562
Examples
25452563
--------
@@ -2548,7 +2566,7 @@ cdef class YearOffset(SingleConstructorOffset):
25482566

25492567
>>> pd.tseries.offsets.YearEnd(n=1, month=6).rule_code
25502568
'YE-JUN'
2551-
""" # noqa
2569+
"""
25522570
month = MONTH_ALIASES[self.month]
25532571
return f"{self._prefix}-{month}"
25542572

@@ -3540,8 +3558,10 @@ cdef class Week(SingleConstructorOffset):
35403558

35413559
See Also
35423560
--------
3543-
tseries.offsets.Hour.name : Returns a string representing the base frequency of 'h'.
3544-
tseries.offsets.Day.name : Returns a string representing the base frequency of 'D'.
3561+
tseries.offsets.Hour.name :
3562+
Returns a string representing the base frequency of 'h'.
3563+
tseries.offsets.Day.name :
3564+
Returns a string representing the base frequency of 'D'.
35453565

35463566
Examples
35473567
--------
@@ -3550,7 +3570,7 @@ cdef class Week(SingleConstructorOffset):
35503570

35513571
>>> pd.offsets.Week(5).rule_code
35523572
'W'
3553-
""" # noqa
3573+
"""
35543574
suffix = ""
35553575
if self.weekday is not None:
35563576
weekday = int_to_weekday[self.weekday]

0 commit comments

Comments
 (0)