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: fix docstring validation errors for pandas.Timestamp #59458

Open
natmokval opened this issue Aug 9, 2024 · 25 comments
Open

DOC: fix docstring validation errors for pandas.Timestamp #59458

natmokval opened this issue Aug 9, 2024 · 25 comments
Labels
Code Style Code style, linting, code_checks Docs good first issue

Comments

@natmokval
Copy link
Contributor

natmokval commented Aug 9, 2024

follow up on issues #56804 and #58063
pandas has a script for validating docstrings:

pandas/ci/code_checks.sh

Lines 206 to 244 in 0cdc6a4

-i "pandas.Timestamp.combine PR01,SA01" \
-i "pandas.Timestamp.ctime SA01" \
-i "pandas.Timestamp.date SA01" \
-i "pandas.Timestamp.day GL08" \
-i "pandas.Timestamp.fold GL08" \
-i "pandas.Timestamp.fromordinal SA01" \
-i "pandas.Timestamp.fromtimestamp PR01,SA01" \
-i "pandas.Timestamp.hour GL08" \
-i "pandas.Timestamp.max PR02" \
-i "pandas.Timestamp.microsecond GL08" \
-i "pandas.Timestamp.min PR02" \
-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.quarter SA01" \
-i "pandas.Timestamp.replace PR07,SA01" \
-i "pandas.Timestamp.resolution PR02" \
-i "pandas.Timestamp.second GL08" \
-i "pandas.Timestamp.strptime PR01,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.today SA01" \
-i "pandas.Timestamp.toordinal 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.utcoffset SA01" \
-i "pandas.Timestamp.utctimetuple SA01" \
-i "pandas.Timestamp.value GL08" \
-i "pandas.Timestamp.year GL08" \

Currently, some methods fail docstring validation check.
The task here is:

  • take 2-4 methods
  • run: scripts/validate_docstrings.py <method-name>
  • fix the docstrings according to whatever error is reported
  • remove those methods from code_checks.sh script
  • commit, push, open pull request

Example:

scripts/validate_docstrings.py pandas.Timestamp.tz_localize

pandas.Timestamp.tz_localize fails with the SA01 error

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

1 Errors found for `pandas.Timestamp.tz_localize`:
        SA01    See Also section not found

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

@natmokval natmokval added the Docs label Aug 9, 2024
@natmokval natmokval assigned natmokval and unassigned natmokval Aug 9, 2024
@natmokval natmokval added Code Style Code style, linting, code_checks good first issue labels Aug 9, 2024
@mimistiv
Copy link
Contributor

mimistiv commented Aug 9, 2024

I will take
pandas.Timestamp.combine
pandas.Timestamp.ctime
pandas.Timestamp.date

@EduardAkhmetshin
Copy link
Contributor

EduardAkhmetshin commented Aug 9, 2024

Taking replace, normalize, to_numpy, and to_period

@NavaneetthaSundararaj
Copy link

NavaneetthaSundararaj commented Aug 9, 2024

Listing as a checklist to tracked the tasks that are already picked

@NavaneetthaSundararaj
Copy link

I will take:

pandas.Timestamp.hour
pandas.Timestamp.max
pandas.Timestamp.microsecond
pandas.Timestamp.min

@dnajjar
Copy link

dnajjar commented Aug 9, 2024

I'll take
"pandas.Timestamp.today"
"pandas.Timestamp.toordinal "

@jsngn
Copy link
Contributor

jsngn commented Aug 9, 2024

I'll take

-i "pandas.Timestamp.strptime PR01,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" \

@zocacc
Copy link

zocacc commented Aug 10, 2024

I'll take
-i "pandas.Timestamp.year GL08"
-i "pandas.Timestamp.value GL08" \

@josh-tan77
Copy link

i'll take

-i pandas.Timestamp.month_name SA01
-i "pandas.Timestamp.quarter SA01

@znarfm
Copy link

znarfm commented Aug 10, 2024

I'll take

-i "pandas.Timestamp.fromordinal SA01"
-i "pandas.Timestamp.fromtimestamp PR01,SA01"

@CICDooley
Copy link

I'll take:
-i "pandas.Timestamp.minute GL08"
-i "pandas.Timestamp.month GL08"
-i "pandas.Timestamp.nanosecond GL08"
-i "pandas.Timestamp.second GL08" \

@shreyas-dev
Copy link
Contributor

shreyas-dev commented Aug 11, 2024

I'll take:

-i "pandas.Timestamp.unit SA01" \
 -i "pandas.Timestamp.utcoffset SA01" \
 -i "pandas.Timestamp.utctimetuple SA01"

@MichaelMoyles
Copy link
Contributor

I'll take:
pandas.Timestamp.tz_localize
pandas.Timestamp.tzname
pandas.Timestamp.utcfromtimestamp

@Blacksujit
Copy link

Blacksujit commented Aug 13, 2024

i will take:

-i "pandas.Timestamp.utcoffset SA01"
-i "pandas.Timestamp.utctimetuple SA01" \

@40gilad
Copy link

40gilad commented Aug 22, 2024

ill take:
-i "pandas.Timestamp.utcfromtimestamp PR01,SA01"
-i "pandas.Timestamp.utcoffset SA01"
-i "pandas.Timestamp.utctimetuple SA01" \

@40gilad
Copy link

40gilad commented Aug 22, 2024

did anyone understand how it should be done? im chaning the doc of my functions in timestamp.pyx, nattype.pyx and nothing is being changed when im running scripts/validate_docstrings.py

@natmokval
Copy link
Contributor Author

did anyone understand how it should be done? im chaning the doc of my functions in timestamp.pyx, nattype.pyx and nothing is being changed when im running scripts/validate_docstrings.py

@40gilad, did you rebuild pandas after your changes?
You need to compile pandas again each time the C extensions change, for example if you modified any file in pandas/_libs.
Please check the documetation "Contributing to pandas", particularly the section: build and install pandas

@40gilad
Copy link

40gilad commented Aug 22, 2024

did anyone understand how it should be done? im chaning the doc of my functions in timestamp.pyx, nattype.pyx and nothing is being changed when im running scripts/validate_docstrings.py

@40gilad, did you rebuild pandas after your changes? You need to compile pandas again each time the C extensions change, for example if you modified any file in pandas/_libs. Please check the documetation "Contributing to pandas", particularly the section: build and install pandas

i get:
error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\HostX86\x64\link.exe' failed with exit code 1120

@natmokval
Copy link
Contributor Author

It seems like the only method not picked is pandas.Timestamp.resolution. I will work on this method.

@NavaneetthaSundararaj
Copy link

I will take:

pandas.Timestamp.hour pandas.Timestamp.max pandas.Timestamp.microsecond pandas.Timestamp.min

Hour and microsecond seems to be done by #59622

@asdkfjsd
Copy link
Contributor

i see those question are still on code_checks.sh
could i take

-i "pandas.Timestamp.nanosecond GL08"
-i "pandas.Timestamp.year GL08" \

@mimistiv
Copy link
Contributor

i see those question are still on code_checks.sh could i take

-i "pandas.Timestamp.nanosecond GL08"
-i "pandas.Timestamp.year GL08" \

Hello @asdkfjsd I have a PR open for this and have been waiting for a review for a while now.
@MarcoGorelli

@asdkfjsd
Copy link
Contributor

i see those question are still on code_checks.sh could i take

-i "pandas.Timestamp.nanosecond GL08"
-i "pandas.Timestamp.year GL08" \

Hello @asdkfjsd I have a PR open for this and have been waiting for a review for a while now. @MarcoGorelli

i'm sorry , i will find another one

@amitsubhashchejara
Copy link

I think all the tasks are picked already 😅.

@vineethsaivs
Copy link

I'll take:
pandas.Timestamp.tz_localize
pandas.Timestamp.toordinal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Docs good first issue
Projects
None yet
Development

No branches or pull requests