Skip to content

Commit 91875d0

Browse files
DOC: fix PR02 for pandas.tseries.offsets.* (#59485)
* Correcting PR02 for classes in offsets.pyx * remove remaining PR02 issues in offsets.pyx * revert for errored classes * revert dependent classes --------- Co-authored-by: Abhinav Thimma <[email protected]>
1 parent 672cb16 commit 91875d0

File tree

2 files changed

+21
-36
lines changed

2 files changed

+21
-36
lines changed

ci/code_checks.sh

+3-18
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
406406
-i "pandas.set_eng_float_format RT03,SA01" \
407407
-i "pandas.testing.assert_extension_array_equal SA01" \
408408
-i "pandas.tseries.offsets.BDay PR02,SA01" \
409-
-i "pandas.tseries.offsets.BQuarterBegin PR02" \
410409
-i "pandas.tseries.offsets.BQuarterBegin.freqstr SA01" \
411410
-i "pandas.tseries.offsets.BQuarterBegin.is_on_offset GL08" \
412411
-i "pandas.tseries.offsets.BQuarterBegin.n GL08" \
@@ -428,7 +427,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
428427
-i "pandas.tseries.offsets.BYearBegin.nanos GL08" \
429428
-i "pandas.tseries.offsets.BYearBegin.normalize GL08" \
430429
-i "pandas.tseries.offsets.BYearBegin.rule_code GL08" \
431-
-i "pandas.tseries.offsets.BYearEnd PR02" \
432430
-i "pandas.tseries.offsets.BYearEnd.freqstr SA01" \
433431
-i "pandas.tseries.offsets.BYearEnd.is_on_offset GL08" \
434432
-i "pandas.tseries.offsets.BYearEnd.month GL08" \
@@ -517,7 +515,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
517515
-i "pandas.tseries.offsets.CustomBusinessMonthEnd.normalize GL08" \
518516
-i "pandas.tseries.offsets.CustomBusinessMonthEnd.rule_code GL08" \
519517
-i "pandas.tseries.offsets.CustomBusinessMonthEnd.weekmask GL08" \
520-
-i "pandas.tseries.offsets.DateOffset PR02" \
521518
-i "pandas.tseries.offsets.DateOffset.freqstr SA01" \
522519
-i "pandas.tseries.offsets.DateOffset.is_on_offset GL08" \
523520
-i "pandas.tseries.offsets.DateOffset.n GL08" \
@@ -530,14 +527,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
530527
-i "pandas.tseries.offsets.Day.nanos SA01" \
531528
-i "pandas.tseries.offsets.Day.normalize GL08" \
532529
-i "pandas.tseries.offsets.Day.rule_code GL08" \
533-
-i "pandas.tseries.offsets.Easter PR02" \
534530
-i "pandas.tseries.offsets.Easter.freqstr SA01" \
535531
-i "pandas.tseries.offsets.Easter.is_on_offset GL08" \
536532
-i "pandas.tseries.offsets.Easter.n GL08" \
537533
-i "pandas.tseries.offsets.Easter.nanos GL08" \
538534
-i "pandas.tseries.offsets.Easter.normalize GL08" \
539535
-i "pandas.tseries.offsets.Easter.rule_code GL08" \
540-
-i "pandas.tseries.offsets.FY5253 PR02" \
541536
-i "pandas.tseries.offsets.FY5253.freqstr SA01" \
542537
-i "pandas.tseries.offsets.FY5253.get_rule_code_suffix GL08" \
543538
-i "pandas.tseries.offsets.FY5253.get_year_end GL08" \
@@ -549,7 +544,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
549544
-i "pandas.tseries.offsets.FY5253.startingMonth GL08" \
550545
-i "pandas.tseries.offsets.FY5253.variation GL08" \
551546
-i "pandas.tseries.offsets.FY5253.weekday GL08" \
552-
-i "pandas.tseries.offsets.FY5253Quarter PR02" \
553547
-i "pandas.tseries.offsets.FY5253Quarter.freqstr SA01" \
554548
-i "pandas.tseries.offsets.FY5253Quarter.get_rule_code_suffix GL08" \
555549
-i "pandas.tseries.offsets.FY5253Quarter.get_weeks GL08" \
@@ -563,14 +557,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
563557
-i "pandas.tseries.offsets.FY5253Quarter.variation GL08" \
564558
-i "pandas.tseries.offsets.FY5253Quarter.weekday GL08" \
565559
-i "pandas.tseries.offsets.FY5253Quarter.year_has_extra_week GL08" \
566-
-i "pandas.tseries.offsets.Hour PR02" \
567560
-i "pandas.tseries.offsets.Hour.freqstr SA01" \
568561
-i "pandas.tseries.offsets.Hour.is_on_offset GL08" \
569562
-i "pandas.tseries.offsets.Hour.n GL08" \
570563
-i "pandas.tseries.offsets.Hour.nanos SA01" \
571564
-i "pandas.tseries.offsets.Hour.normalize GL08" \
572565
-i "pandas.tseries.offsets.Hour.rule_code GL08" \
573-
-i "pandas.tseries.offsets.LastWeekOfMonth PR02,SA01" \
566+
-i "pandas.tseries.offsets.LastWeekOfMonth SA01" \
574567
-i "pandas.tseries.offsets.LastWeekOfMonth.freqstr SA01" \
575568
-i "pandas.tseries.offsets.LastWeekOfMonth.is_on_offset GL08" \
576569
-i "pandas.tseries.offsets.LastWeekOfMonth.n GL08" \
@@ -579,28 +572,24 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
579572
-i "pandas.tseries.offsets.LastWeekOfMonth.rule_code GL08" \
580573
-i "pandas.tseries.offsets.LastWeekOfMonth.week GL08" \
581574
-i "pandas.tseries.offsets.LastWeekOfMonth.weekday GL08" \
582-
-i "pandas.tseries.offsets.Micro PR02" \
583575
-i "pandas.tseries.offsets.Micro.freqstr SA01" \
584576
-i "pandas.tseries.offsets.Micro.is_on_offset GL08" \
585577
-i "pandas.tseries.offsets.Micro.n GL08" \
586578
-i "pandas.tseries.offsets.Micro.nanos SA01" \
587579
-i "pandas.tseries.offsets.Micro.normalize GL08" \
588580
-i "pandas.tseries.offsets.Micro.rule_code GL08" \
589-
-i "pandas.tseries.offsets.Milli PR02" \
590581
-i "pandas.tseries.offsets.Milli.freqstr SA01" \
591582
-i "pandas.tseries.offsets.Milli.is_on_offset GL08" \
592583
-i "pandas.tseries.offsets.Milli.n GL08" \
593584
-i "pandas.tseries.offsets.Milli.nanos SA01" \
594585
-i "pandas.tseries.offsets.Milli.normalize GL08" \
595586
-i "pandas.tseries.offsets.Milli.rule_code GL08" \
596-
-i "pandas.tseries.offsets.Minute PR02" \
597587
-i "pandas.tseries.offsets.Minute.freqstr SA01" \
598588
-i "pandas.tseries.offsets.Minute.is_on_offset GL08" \
599589
-i "pandas.tseries.offsets.Minute.n GL08" \
600590
-i "pandas.tseries.offsets.Minute.nanos SA01" \
601591
-i "pandas.tseries.offsets.Minute.normalize GL08" \
602592
-i "pandas.tseries.offsets.Minute.rule_code GL08" \
603-
-i "pandas.tseries.offsets.MonthBegin PR02" \
604593
-i "pandas.tseries.offsets.MonthBegin.freqstr SA01" \
605594
-i "pandas.tseries.offsets.MonthBegin.is_on_offset GL08" \
606595
-i "pandas.tseries.offsets.MonthBegin.n GL08" \
@@ -613,14 +602,12 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
613602
-i "pandas.tseries.offsets.MonthEnd.nanos GL08" \
614603
-i "pandas.tseries.offsets.MonthEnd.normalize GL08" \
615604
-i "pandas.tseries.offsets.MonthEnd.rule_code GL08" \
616-
-i "pandas.tseries.offsets.Nano PR02" \
617605
-i "pandas.tseries.offsets.Nano.freqstr SA01" \
618606
-i "pandas.tseries.offsets.Nano.is_on_offset GL08" \
619607
-i "pandas.tseries.offsets.Nano.n GL08" \
620608
-i "pandas.tseries.offsets.Nano.nanos SA01" \
621609
-i "pandas.tseries.offsets.Nano.normalize GL08" \
622610
-i "pandas.tseries.offsets.Nano.rule_code GL08" \
623-
-i "pandas.tseries.offsets.QuarterBegin PR02" \
624611
-i "pandas.tseries.offsets.QuarterBegin.freqstr SA01" \
625612
-i "pandas.tseries.offsets.QuarterBegin.is_on_offset GL08" \
626613
-i "pandas.tseries.offsets.QuarterBegin.n GL08" \
@@ -635,14 +622,13 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
635622
-i "pandas.tseries.offsets.QuarterEnd.normalize GL08" \
636623
-i "pandas.tseries.offsets.QuarterEnd.rule_code GL08" \
637624
-i "pandas.tseries.offsets.QuarterEnd.startingMonth GL08" \
638-
-i "pandas.tseries.offsets.Second PR02" \
639625
-i "pandas.tseries.offsets.Second.freqstr SA01" \
640626
-i "pandas.tseries.offsets.Second.is_on_offset GL08" \
641627
-i "pandas.tseries.offsets.Second.n GL08" \
642628
-i "pandas.tseries.offsets.Second.nanos SA01" \
643629
-i "pandas.tseries.offsets.Second.normalize GL08" \
644630
-i "pandas.tseries.offsets.Second.rule_code GL08" \
645-
-i "pandas.tseries.offsets.SemiMonthBegin PR02,SA01" \
631+
-i "pandas.tseries.offsets.SemiMonthBegin SA01" \
646632
-i "pandas.tseries.offsets.SemiMonthBegin.day_of_month GL08" \
647633
-i "pandas.tseries.offsets.SemiMonthBegin.freqstr SA01" \
648634
-i "pandas.tseries.offsets.SemiMonthBegin.is_on_offset GL08" \
@@ -665,15 +651,14 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
665651
-i "pandas.tseries.offsets.Tick.nanos SA01" \
666652
-i "pandas.tseries.offsets.Tick.normalize GL08" \
667653
-i "pandas.tseries.offsets.Tick.rule_code GL08" \
668-
-i "pandas.tseries.offsets.Week PR02" \
669654
-i "pandas.tseries.offsets.Week.freqstr SA01" \
670655
-i "pandas.tseries.offsets.Week.is_on_offset GL08" \
671656
-i "pandas.tseries.offsets.Week.n GL08" \
672657
-i "pandas.tseries.offsets.Week.nanos GL08" \
673658
-i "pandas.tseries.offsets.Week.normalize GL08" \
674659
-i "pandas.tseries.offsets.Week.rule_code GL08" \
675660
-i "pandas.tseries.offsets.Week.weekday GL08" \
676-
-i "pandas.tseries.offsets.WeekOfMonth PR02,SA01" \
661+
-i "pandas.tseries.offsets.WeekOfMonth SA01" \
677662
-i "pandas.tseries.offsets.WeekOfMonth.freqstr SA01" \
678663
-i "pandas.tseries.offsets.WeekOfMonth.is_on_offset GL08" \
679664
-i "pandas.tseries.offsets.WeekOfMonth.n GL08" \

pandas/_libs/tslibs/offsets.pyx

+18-18
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ cdef class Hour(Tick):
11471147
"""
11481148
Offset ``n`` hours.
11491149
1150-
Parameters
1150+
Attributes
11511151
----------
11521152
n : int, default 1
11531153
The number of hours represented.
@@ -1183,7 +1183,7 @@ cdef class Minute(Tick):
11831183
"""
11841184
Offset ``n`` minutes.
11851185
1186-
Parameters
1186+
Attributes
11871187
----------
11881188
n : int, default 1
11891189
The number of minutes represented.
@@ -1219,7 +1219,7 @@ cdef class Second(Tick):
12191219
"""
12201220
Offset ``n`` seconds.
12211221
1222-
Parameters
1222+
Attributes
12231223
----------
12241224
n : int, default 1
12251225
The number of seconds represented.
@@ -1255,7 +1255,7 @@ cdef class Milli(Tick):
12551255
"""
12561256
Offset ``n`` milliseconds.
12571257
1258-
Parameters
1258+
Attributes
12591259
----------
12601260
n : int, default 1
12611261
The number of milliseconds represented.
@@ -1292,7 +1292,7 @@ cdef class Micro(Tick):
12921292
"""
12931293
Offset ``n`` microseconds.
12941294
1295-
Parameters
1295+
Attributes
12961296
----------
12971297
n : int, default 1
12981298
The number of microseconds represented.
@@ -1329,7 +1329,7 @@ cdef class Nano(Tick):
13291329
"""
13301330
Offset ``n`` nanoseconds.
13311331
1332-
Parameters
1332+
Attributes
13331333
----------
13341334
n : int, default 1
13351335
The number of nanoseconds represented.
@@ -1616,7 +1616,7 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta):
16161616
Besides, adding a DateOffsets specified by the singular form of the date
16171617
component can be used to replace certain component of the timestamp.
16181618
1619-
Parameters
1619+
Attributes
16201620
----------
16211621
n : int, default 1
16221622
The number of time periods the offset represents.
@@ -2506,7 +2506,7 @@ cdef class BYearEnd(YearOffset):
25062506
"""
25072507
DateOffset increments between the last business day of the year.
25082508
2509-
Parameters
2509+
Attributes
25102510
----------
25112511
n : int, default 1
25122512
The number of years represented.
@@ -2804,7 +2804,7 @@ cdef class BQuarterBegin(QuarterOffset):
28042804
startingMonth = 2 corresponds to dates like 2/01/2007, 5/01/2007, ...
28052805
startingMonth = 3 corresponds to dates like 3/01/2007, 6/01/2007, ...
28062806
2807-
Parameters
2807+
Attributes
28082808
----------
28092809
n : int, default 1
28102810
The number of quarters represented.
@@ -2886,7 +2886,7 @@ cdef class QuarterBegin(QuarterOffset):
28862886
startingMonth = 2 corresponds to dates like 2/01/2007, 5/01/2007, ...
28872887
startingMonth = 3 corresponds to dates like 3/01/2007, 6/01/2007, ...
28882888
2889-
Parameters
2889+
Attributes
28902890
----------
28912891
n : int, default 1
28922892
The number of quarters represented.
@@ -2984,7 +2984,7 @@ cdef class MonthBegin(MonthOffset):
29842984
29852985
MonthBegin goes to the next date which is a start of the month.
29862986
2987-
Parameters
2987+
Attributes
29882988
----------
29892989
n : int, default 1
29902990
The number of months represented.
@@ -3272,7 +3272,7 @@ cdef class SemiMonthBegin(SemiMonthOffset):
32723272
"""
32733273
Two DateOffset's per month repeating on the first day of the month & day_of_month.
32743274
3275-
Parameters
3275+
Attributes
32763276
----------
32773277
n : int, default 1
32783278
The number of months represented.
@@ -3304,7 +3304,7 @@ cdef class Week(SingleConstructorOffset):
33043304
"""
33053305
Weekly offset.
33063306
3307-
Parameters
3307+
Attributes
33083308
----------
33093309
n : int, default 1
33103310
The number of weeks represented.
@@ -3477,7 +3477,7 @@ cdef class WeekOfMonth(WeekOfMonthMixin):
34773477
"""
34783478
Describes monthly dates like "the Tuesday of the 2nd week of each month".
34793479
3480-
Parameters
3480+
Attributes
34813481
----------
34823482
n : int, default 1
34833483
The number of months represented.
@@ -3554,7 +3554,7 @@ cdef class LastWeekOfMonth(WeekOfMonthMixin):
35543554
35553555
For example "the last Tuesday of each month".
35563556
3557-
Parameters
3557+
Attributes
35583558
----------
35593559
n : int, default 1
35603560
The number of months represented.
@@ -3694,7 +3694,7 @@ cdef class FY5253(FY5253Mixin):
36943694
X is a specific day of the week.
36953695
Y is a certain month of the year
36963696
3697-
Parameters
3697+
Attributes
36983698
----------
36993699
n : int
37003700
The number of fiscal years represented.
@@ -3897,7 +3897,7 @@ cdef class FY5253Quarter(FY5253Mixin):
38973897
startingMonth = 2 corresponds to dates like 2/28/2007, 5/31/2007, ...
38983898
startingMonth = 3 corresponds to dates like 3/30/2007, 6/29/2007, ...
38993899
3900-
Parameters
3900+
Attributes
39013901
----------
39023902
n : int
39033903
The number of business quarters represented.
@@ -4132,7 +4132,7 @@ cdef class Easter(SingleConstructorOffset):
41324132
41334133
Right now uses the revised method which is valid in years 1583-4099.
41344134
4135-
Parameters
4135+
Attributes
41364136
----------
41374137
n : int, default 1
41384138
The number of years represented.

0 commit comments

Comments
 (0)