Skip to content
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

DOC: Enforce Numpy Docstring Validation | pandas.tseries.offsets.Week to YearEnd #58536

Closed
Nrezhang opened this issue May 2, 2024 · 3 comments · Fixed by #59475
Closed

DOC: Enforce Numpy Docstring Validation | pandas.tseries.offsets.Week to YearEnd #58536

Nrezhang opened this issue May 2, 2024 · 3 comments · Fixed by #59475
Labels

Comments

@Nrezhang
Copy link
Contributor

Nrezhang commented May 2, 2024

DOC: Enforce Numpy Docstring Validation (Parent Issue) #58063

Documentation problem

Pandas has a script for validating docstrings in code_checks.sh. Currently, some methods fail some of these checks.

pandas.tseries

pandas/ci/code_checks.sh

Lines 1217 to 1261 in c468028

-i "pandas.tseries.offsets.Week PR02" \
-i "pandas.tseries.offsets.Week.copy SA01" \
-i "pandas.tseries.offsets.Week.freqstr SA01" \
-i "pandas.tseries.offsets.Week.is_on_offset GL08" \
-i "pandas.tseries.offsets.Week.kwds SA01" \
-i "pandas.tseries.offsets.Week.n GL08" \
-i "pandas.tseries.offsets.Week.name SA01" \
-i "pandas.tseries.offsets.Week.nanos GL08" \
-i "pandas.tseries.offsets.Week.normalize GL08" \
-i "pandas.tseries.offsets.Week.rule_code GL08" \
-i "pandas.tseries.offsets.Week.weekday GL08" \
-i "pandas.tseries.offsets.WeekOfMonth PR02,SA01" \
-i "pandas.tseries.offsets.WeekOfMonth.copy SA01" \
-i "pandas.tseries.offsets.WeekOfMonth.freqstr SA01" \
-i "pandas.tseries.offsets.WeekOfMonth.is_on_offset GL08" \
-i "pandas.tseries.offsets.WeekOfMonth.kwds SA01" \
-i "pandas.tseries.offsets.WeekOfMonth.n GL08" \
-i "pandas.tseries.offsets.WeekOfMonth.name SA01" \
-i "pandas.tseries.offsets.WeekOfMonth.nanos GL08" \
-i "pandas.tseries.offsets.WeekOfMonth.normalize GL08" \
-i "pandas.tseries.offsets.WeekOfMonth.rule_code GL08" \
-i "pandas.tseries.offsets.WeekOfMonth.week GL08" \
-i "pandas.tseries.offsets.WeekOfMonth.weekday GL08" \
-i "pandas.tseries.offsets.YearBegin PR02" \
-i "pandas.tseries.offsets.YearBegin.copy SA01" \
-i "pandas.tseries.offsets.YearBegin.freqstr SA01" \
-i "pandas.tseries.offsets.YearBegin.is_on_offset GL08" \
-i "pandas.tseries.offsets.YearBegin.kwds SA01" \
-i "pandas.tseries.offsets.YearBegin.month GL08" \
-i "pandas.tseries.offsets.YearBegin.n GL08" \
-i "pandas.tseries.offsets.YearBegin.name SA01" \
-i "pandas.tseries.offsets.YearBegin.nanos GL08" \
-i "pandas.tseries.offsets.YearBegin.normalize GL08" \
-i "pandas.tseries.offsets.YearBegin.rule_code GL08" \
-i "pandas.tseries.offsets.YearEnd PR02" \
-i "pandas.tseries.offsets.YearEnd.copy SA01" \
-i "pandas.tseries.offsets.YearEnd.freqstr SA01" \
-i "pandas.tseries.offsets.YearEnd.is_on_offset GL08" \
-i "pandas.tseries.offsets.YearEnd.kwds SA01" \
-i "pandas.tseries.offsets.YearEnd.month GL08" \
-i "pandas.tseries.offsets.YearEnd.n GL08" \
-i "pandas.tseries.offsets.YearEnd.name SA01" \
-i "pandas.tseries.offsets.YearEnd.nanos GL08" \
-i "pandas.tseries.offsets.YearEnd.normalize GL08" \
-i "pandas.tseries.offsets.YearEnd.rule_code GL08" \

The task is:

  1. take 1-5 methods

  2. run: scripts/validate_docstrings.py --format=actions <method-name>

example command: scripts/validate_docstrings.py --format=actions pandas.Categorical.__array__
example output:

################################################################################
################################## Validation ##################################
################################################################################

2 Errors found for `pandas.Categorical.__array__`:
    ES01    No extended summary found
    SA01    See Also section not found
  1. check if validation docstrings passes for those methods, and if it’s necessary fix the docstrings according to whatever error is reported. Note: We've chosen to ignore ES01 errors, these are not required to be fixed.

  2. remove those methods from code_checks.sh if all errors are cleared and the docstring is correct, otherwise, remove the specific error that was fixed from the list of errors for that method.

  3. commit, push, open pull request

Please don't comment take as multiple people can work on this issue. You also don't need to ask for permission to work on this, just comment on which methods are you going to work : )

If you're new contributor, please check the contributing guide

thanks @datapythonista @jordan-d-murphy for the inspiration for this

@Nrezhang Nrezhang added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels May 2, 2024
@tuhinsharma121
Copy link
Contributor

working on

 -i "pandas.tseries.offsets.Week.copy SA01" \

@tuhinsharma121
Copy link
Contributor

working on

        -i "pandas.tseries.offsets.BusinessDay PR02,SA01" \
        -i "pandas.tseries.offsets.BDay PR02,SA01" \

@tuhinsharma121
Copy link
Contributor

tuhinsharma121 commented May 18, 2024

working on

pandas.tseries.offsets.Day PR02

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.

3 participants