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.Datetime #58066

Closed
jordan-d-murphy opened this issue Mar 29, 2024 · 12 comments · Fixed by #58477
Closed

DOC: Enforce Numpy Docstring Validation | pandas.Datetime #58066

jordan-d-murphy opened this issue Mar 29, 2024 · 12 comments · Fixed by #58477

Comments

@jordan-d-murphy
Copy link
Contributor

jordan-d-murphy commented Mar 29, 2024

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

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

pandas.Datetime

pandas/ci/code_checks.sh

Lines 135 to 167 in c468028

-i "pandas.DatetimeIndex.ceil SA01" \
-i "pandas.DatetimeIndex.date SA01" \
-i "pandas.DatetimeIndex.day SA01" \
-i "pandas.DatetimeIndex.day_name SA01" \
-i "pandas.DatetimeIndex.day_of_year SA01" \
-i "pandas.DatetimeIndex.dayofyear SA01" \
-i "pandas.DatetimeIndex.floor SA01" \
-i "pandas.DatetimeIndex.freqstr SA01" \
-i "pandas.DatetimeIndex.hour SA01" \
-i "pandas.DatetimeIndex.indexer_at_time PR01,RT03" \
-i "pandas.DatetimeIndex.indexer_between_time RT03" \
-i "pandas.DatetimeIndex.inferred_freq SA01" \
-i "pandas.DatetimeIndex.is_leap_year SA01" \
-i "pandas.DatetimeIndex.microsecond SA01" \
-i "pandas.DatetimeIndex.minute SA01" \
-i "pandas.DatetimeIndex.month SA01" \
-i "pandas.DatetimeIndex.month_name SA01" \
-i "pandas.DatetimeIndex.nanosecond SA01" \
-i "pandas.DatetimeIndex.quarter SA01" \
-i "pandas.DatetimeIndex.round SA01" \
-i "pandas.DatetimeIndex.second SA01" \
-i "pandas.DatetimeIndex.snap PR01,RT03,SA01" \
-i "pandas.DatetimeIndex.std PR01,RT03" \
-i "pandas.DatetimeIndex.time SA01" \
-i "pandas.DatetimeIndex.timetz SA01" \
-i "pandas.DatetimeIndex.to_period RT03" \
-i "pandas.DatetimeIndex.to_pydatetime RT03,SA01" \
-i "pandas.DatetimeIndex.tz SA01" \
-i "pandas.DatetimeIndex.tz_convert RT03" \
-i "pandas.DatetimeIndex.year SA01" \
-i "pandas.DatetimeTZDtype SA01" \
-i "pandas.DatetimeTZDtype.tz SA01" \
-i "pandas.DatetimeTZDtype.unit SA01" \

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 for the inspiration for this issue!

@iridiium
Copy link

Taking:

pandas.DatetimeIndex.to_period
pandas.DatetimeIndex.to_pydatetime

@KeiOshima
Copy link
Contributor

KeiOshima commented Apr 17, 2024

Will work on:

pandas.DatetimeIndex.year
pandas.DatetimeIndex.month

@shriyakalakata
Copy link
Contributor

Working on pandas.DatetimeIndex.day_name, pandas.DatetimeIndex.month_name

@KeiOshima
Copy link
Contributor

working on

pandas.DatetimeIndex.hour
pandas.DatetimeIndex.minute
pandas.DatetimeIndex.second

@KeiOshima
Copy link
Contributor

working on

pandas.DatetimeIndex.day 
pandas.DatetimeIndex.nanosecond
pandas.DatetimeIndex.microsecond 

@gboeker
Copy link
Contributor

gboeker commented Apr 20, 2024

working on

pandas.DatetimeIndex.quarter
pandas.DatetimeIndex.round
pandas.DatetimeIndex.snap
pandas.DatetimeIndex.std
pandas.DatetimeIndex.time
pandas.DatetimeIndex.timetz

@KeiOshima
Copy link
Contributor

KeiOshima commented Apr 20, 2024

working on

pandas.DatetimeIndex.date
pandas.DatetimeIndex.tz

@KeiOshima
Copy link
Contributor

Working on

pandas.DatetimeIndex.day_of_year
pandas.DatetimeIndex.is_leap_year
pandas.DatetimeIndex.inferred_freq 

@tuhinsharma121
Copy link
Contributor

working on

 -i "pandas.DatetimeTZDtype SA01" \ 
 -i "pandas.DatetimeTZDtype.tz SA01" \ 
 -i "pandas.DatetimeTZDtype.unit SA01" \ 

@tuhinsharma121
Copy link
Contributor

tuhinsharma121 commented Apr 24, 2024

Now working on

 -i "pandas.DatetimeIndex.tz_convert RT03" \ 
-i "pandas.DatetimeIndex.indexer_between_time RT03" \
-i "pandas.DatetimeIndex.freqstr SA01" \

@tuhinsharma121
Copy link
Contributor

working on

        -i "pandas.DatetimeIndex.std PR01,RT03" \
        -i "pandas.DatetimeIndex.to_period RT03" \
        -i "pandas.DatetimeIndex.to_pydatetime RT03,SA01" \

@tuhinsharma121
Copy link
Contributor

working on

        -i "pandas.DatetimeIndex.indexer_at_time PR01,RT03" \
        -i "pandas.DatetimeIndex.snap PR01,RT03" \

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

Successfully merging a pull request may close this issue.

6 participants