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.Timestamp #58505

Open
gboeker opened this issue May 1, 2024 · 4 comments
Open

DOC: Enforce Numpy Docstring Validation | pandas.Timestamp #58505

gboeker opened this issue May 1, 2024 · 4 comments
Labels
Docs Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@gboeker
Copy link
Contributor

gboeker commented May 1, 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.Timestamp

pandas/ci/code_checks.sh

Lines 518 to 585 in c468028

-i "pandas.Timestamp PR07,SA01" \
-i "pandas.Timestamp.as_unit SA01" \
-i "pandas.Timestamp.asm8 SA01" \
-i "pandas.Timestamp.astimezone SA01" \
-i "pandas.Timestamp.ceil SA01" \
-i "pandas.Timestamp.combine PR01,SA01" \
-i "pandas.Timestamp.ctime SA01" \
-i "pandas.Timestamp.date SA01" \
-i "pandas.Timestamp.day GL08" \
-i "pandas.Timestamp.day_name SA01" \
-i "pandas.Timestamp.day_of_week SA01" \
-i "pandas.Timestamp.day_of_year SA01" \
-i "pandas.Timestamp.dayofweek SA01" \
-i "pandas.Timestamp.dayofyear SA01" \
-i "pandas.Timestamp.days_in_month SA01" \
-i "pandas.Timestamp.daysinmonth SA01" \
-i "pandas.Timestamp.dst SA01" \
-i "pandas.Timestamp.floor SA01" \
-i "pandas.Timestamp.fold GL08" \
-i "pandas.Timestamp.fromordinal SA01" \
-i "pandas.Timestamp.fromtimestamp PR01,SA01" \
-i "pandas.Timestamp.hour GL08" \
-i "pandas.Timestamp.is_leap_year SA01" \
-i "pandas.Timestamp.isocalendar SA01" \
-i "pandas.Timestamp.isoformat SA01" \
-i "pandas.Timestamp.isoweekday SA01" \
-i "pandas.Timestamp.max PR02,PR07,SA01" \
-i "pandas.Timestamp.microsecond GL08" \
-i "pandas.Timestamp.min PR02,PR07,SA01" \
-i "pandas.Timestamp.minute GL08" \
-i "pandas.Timestamp.month GL08" \
-i "pandas.Timestamp.month_name SA01" \
-i "pandas.Timestamp.nanosecond GL08" \
-i "pandas.Timestamp.normalize SA01" \
-i "pandas.Timestamp.now SA01" \
-i "pandas.Timestamp.quarter SA01" \
-i "pandas.Timestamp.replace PR07,SA01" \
-i "pandas.Timestamp.resolution PR02,PR07,SA01" \
-i "pandas.Timestamp.round SA01" \
-i "pandas.Timestamp.second GL08" \
-i "pandas.Timestamp.strftime SA01" \
-i "pandas.Timestamp.strptime PR01,SA01" \
-i "pandas.Timestamp.time SA01" \
-i "pandas.Timestamp.timestamp SA01" \
-i "pandas.Timestamp.timetuple SA01" \
-i "pandas.Timestamp.timetz SA01" \
-i "pandas.Timestamp.to_datetime64 SA01" \
-i "pandas.Timestamp.to_julian_date SA01" \
-i "pandas.Timestamp.to_numpy PR01" \
-i "pandas.Timestamp.to_period PR01,SA01" \
-i "pandas.Timestamp.to_pydatetime PR01,SA01" \
-i "pandas.Timestamp.today SA01" \
-i "pandas.Timestamp.toordinal SA01" \
-i "pandas.Timestamp.tz SA01" \
-i "pandas.Timestamp.tz_convert SA01" \
-i "pandas.Timestamp.tz_localize SA01" \
-i "pandas.Timestamp.tzinfo GL08" \
-i "pandas.Timestamp.tzname SA01" \
-i "pandas.Timestamp.unit SA01" \
-i "pandas.Timestamp.utcfromtimestamp PR01,SA01" \
-i "pandas.Timestamp.utcnow SA01" \
-i "pandas.Timestamp.utcoffset SA01" \
-i "pandas.Timestamp.utctimetuple SA01" \
-i "pandas.Timestamp.value GL08" \
-i "pandas.Timestamp.week SA01" \
-i "pandas.Timestamp.weekday SA01" \
-i "pandas.Timestamp.weekofyear SA01" \
-i "pandas.Timestamp.year 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 issue!

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

working on

-i "pandas.Timestamp.day_name SA01" \ 
 -i "pandas.Timestamp.day_of_week SA01" \ 
 -i "pandas.Timestamp.day_of_year SA01" \ 
 -i "pandas.Timestamp.dayofweek SA01" \ 
 -i "pandas.Timestamp.dayofyear SA01" \ 
 -i "pandas.Timestamp.days_in_month SA01" \ 
 -i "pandas.Timestamp.daysinmonth SA01" \ 

@tuhinsharma121
Copy link
Contributor

tuhinsharma121 commented May 2, 2024

working on

-i "pandas.Timestamp PR07,SA01" \

@tuhinsharma121
Copy link
Contributor

working on

 -i "pandas.Timestamp.as_unit SA01" \ 

@tuhinsharma121
Copy link
Contributor

working on

pandas.Timestamp.asm8 SA01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

2 participants