Skip to content

DOC: Include missing holiday observance rules #38067

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

Closed
Jeitan opened this issue Nov 25, 2020 · 4 comments · Fixed by #57939
Closed

DOC: Include missing holiday observance rules #38067

Jeitan opened this issue Nov 25, 2020 · 4 comments · Fixed by #57939
Assignees
Labels

Comments

@Jeitan
Copy link

Jeitan commented Nov 25, 2020

Location of the documentation

Timeseries Holiday section in doc/source/user_guide/timeseries.rst.

Documentation problem

The list of available holiday observance rules is incomplete - several available observances are missing.

Suggested fix for documentation

The following observances should be added to the documentation because they are already available:

  • next_workday
  • previous_workday
  • before_nearest_workday
  • after_nearest_workday

Before I examined holiday via TAB-completion I had written my own version of weekend_to_monday; others may likewise re-invent these wheels if they're not documented.

(Updated to remove "weekend_to_monday" because it does the same thing as "next_monday")

@Jeitan Jeitan added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 25, 2020
@Jeitan Jeitan changed the title DOC: DOC: Include missing holiday observance rules Nov 25, 2020
@Jeitan
Copy link
Author

Jeitan commented Nov 25, 2020

I was poking at this, and discovered that weekend_to_monday actually does the same thing that next_monday does. I think I had taken "next Monday" too literally and thought that that would move even other weekdays to Monday. However, the code is actually the same (except for the order in which the weekday is checked). So one of them should probably go, and whichever one survives live in the documentation (personally, I think "weekend_to_monday" is clearer, but I could see wanting to complement previous_friday).
(The remaining 4 should still be documented)

@leonarduschen
Copy link
Contributor

leonarduschen commented Nov 28, 2020

def next_monday(dt: datetime) -> datetime:

We should probably remove next_monday since it's kinda misleading as it doesn't do anything if the current day is not Saturday or Sunday.

@leonarduschen
Copy link
Contributor

There are room for improvement for the docstring as well. For example:

Docstring of before_nearest_workday:

returns previous workday after nearest workday

Docstring of after_nearest_workday:

returns next workday after nearest workday

@mroeschke mroeschke added Frequency DateOffsets and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Aug 14, 2021
@dontgoto
Copy link
Contributor

take

mroeschke pushed a commit that referenced this issue Mar 21, 2024
* fix method docstrings

* add observances to user guide

* add weekend_to_monday to user guide
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this issue May 7, 2024
…v#57939)

* fix method docstrings

* add observances to user guide

* add weekend_to_monday to user guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants