Skip to content

details on weekday argument for DateOffset docs #54332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 25, 2023
18 changes: 18 additions & 0 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,24 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta):
previous midnight.
**kwds
Temporal parameter that add to or replace the offset value.
weekday : int {0, 1, ..., 6}, default 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this go before kwds? that should typically be the last argument

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

A specific integer for the day of the week.
- 0 is Monday
- 1 is Tuesday
- 2 is Wednesday
- 3 is Thursday
- 4 is Friday
- 5 is Saturday
- 6 is Sunday.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look quite right, you need a blank line before "A specific integer"

image

Copy link

@keelancosgrove keelancosgrove Aug 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working with @Detoro on this - we'd like to view the built HTML but have been encountering some issues.
Namely, after running python make.py --single pandas.tseries.offsets.DateOffset in the doc directory, we don't see any output in directory reference/api for DateOffset. We're getting this warning from Sphinx:

/mnt/c/Users/batiu/OneDrive/Desktop/pandasContribution/pandas-toro/doc/source/index.rst:31: WARNING: autosummary references excluded document 'pandas.tseries.offsets.DateOffset'. Ignored.

Are we building this class correctly, and if so why is the class's documentation being excluded by "autosummary references"?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoGorelli PR is updated, can you take another look? We'll squash the commits as well.


Instead Weekday type from dateutil.relativedelta can be used.
- MO is Monday
- TU is Tuesday
- WE is Wednesday
- TH is Thursday
- FR is Friday
- SA is Saturday
- SU is Sunday.

Parameters that **add** to the offset (like Timedelta):

Expand Down