DOC: fix docstring validation errors for `pandas.Timestamp`
follow up on issues #56804 and #58063 pandas has a script for validating docstrings:
https://github.com/pandas-dev/pandas/blob/0cdc6a48302ba1592b8825868de403ff9b0ea2a5/ci/code_checks.sh#L206-L244
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.shscript - 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
I will take
pandas.Timestamp.combine
pandas.Timestamp.ctime
pandas.Timestamp.date
Taking replace, normalize, to_numpy, and to_period
Listing as a checklist to tracked the tasks that are already picked
- [x] -i "pandas.Timestamp.combine PR01,SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277848804
- [x] -i "pandas.Timestamp.ctime SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277848804
- [x] -i "pandas.Timestamp.date SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277848804
- [x] -i "pandas.Timestamp.day GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277915097
- [x] -i "pandas.Timestamp.fold GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277915097
- [x] -i "pandas.Timestamp.fromordinal SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2281748570
- [x] -i "pandas.Timestamp.fromtimestamp PR01,SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2281748570
- [x] -i "pandas.Timestamp.hour GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277964718
- [x] -i "pandas.Timestamp.max PR02" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277964718
- [x] -i "pandas.Timestamp.microsecond GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277964718
- [x] -i "pandas.Timestamp.min PR02" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277964718
- [x] -i "pandas.Timestamp.minute GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282326767
- [x] -i "pandas.Timestamp.month GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282326767
- [x] -i "pandas.Timestamp.month_name SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278954301
- [x] -i "pandas.Timestamp.nanosecond GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282326767
- [x] -i "pandas.Timestamp.normalize SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277858099
- [x] -i "pandas.Timestamp.quarter SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278954301
- [x] -i "pandas.Timestamp.replace PR07,SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277858099
- [x] -i "pandas.Timestamp.resolution PR02" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2283015310
- [x] -i "pandas.Timestamp.second GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282326767
- [x] -i "pandas.Timestamp.strptime PR01,SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278582882
- [x] -i "pandas.Timestamp.timestamp SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278582882
- [x] -i "pandas.Timestamp.timetuple SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278582882
- [x] -i "pandas.Timestamp.timetz SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278582882
- [x] -i "pandas.Timestamp.to_datetime64 SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278582882
- [x] -i "pandas.Timestamp.to_julian_date SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278582882
- [x] -i "pandas.Timestamp.to_numpy PR01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277858099
- [x] -i "pandas.Timestamp.to_period PR01,SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2277858099
- [x] -i "pandas.Timestamp.today SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278150810
- [x] -i "pandas.Timestamp.toordinal SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278150810
- [x] -i "pandas.Timestamp.tz_localize SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282834048
- [x] -i "pandas.Timestamp.tzinfo GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2283015310
- [x] -i "pandas.Timestamp.tzname SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282834048
- [x] -i "pandas.Timestamp.unit SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282679680
- [x] -i "pandas.Timestamp.utcfromtimestamp PR01,SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282834048
- [x] -i "pandas.Timestamp.utcoffset SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282679680
- [x] -i "pandas.Timestamp.utctimetuple SA01" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2282679680
- [x] -i "pandas.Timestamp.value GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278898146
- [x] -i "pandas.Timestamp.year GL08" \ https://github.com/pandas-dev/pandas/issues/59458#issuecomment-2278898146
I will take:
pandas.Timestamp.hour pandas.Timestamp.max pandas.Timestamp.microsecond pandas.Timestamp.min
I'll take "pandas.Timestamp.today" "pandas.Timestamp.toordinal "
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" \
I'll take
-i "pandas.Timestamp.year GL08"
-i "pandas.Timestamp.value GL08" \
i'll take
-i pandas.Timestamp.month_name SA01 -i "pandas.Timestamp.quarter SA01
I'll take
-i "pandas.Timestamp.fromordinal SA01" -i "pandas.Timestamp.fromtimestamp PR01,SA01"
I'll take:
-i "pandas.Timestamp.minute GL08"
-i "pandas.Timestamp.month GL08"
-i "pandas.Timestamp.nanosecond GL08"
-i "pandas.Timestamp.second GL08" \
I'll take:
-i "pandas.Timestamp.unit SA01" \
-i "pandas.Timestamp.utcoffset SA01" \
-i "pandas.Timestamp.utctimetuple SA01"
I'll take: pandas.Timestamp.tz_localize pandas.Timestamp.tzname pandas.Timestamp.utcfromtimestamp
i will take:
-i "pandas.Timestamp.utcoffset SA01"
-i "pandas.Timestamp.utctimetuple SA01" \
I'll take : pandas.Timestamp.tz_localize SA01 pandas.Timestamp.tzinfo GL08 pandas.Timestamp.tzname SA01
ill take:
-i "pandas.Timestamp.utcfromtimestamp PR01,SA01"
-i "pandas.Timestamp.utcoffset SA01"
-i "pandas.Timestamp.utctimetuple SA01" \
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
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
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
It seems like the only method not picked is pandas.Timestamp.resolution. I will work on this method.
I will take:
pandas.Timestamp.hour pandas.Timestamp.max pandas.Timestamp.microsecond pandas.Timestamp.min
Hour and microsecond seems to be done by https://github.com/pandas-dev/pandas/pull/59622
i see those question are still on code_checks.sh could i take
-i "pandas.Timestamp.nanosecond GL08" -i "pandas.Timestamp.year GL08" \
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 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
I think all the tasks are picked already 😅.
I'll take: pandas.Timestamp.tz_localize pandas.Timestamp.toordinal
Do any functions still need to be fixed?
I'll take pandas.Timestamp.resolution
Timestamp.tzinfo has already been resolved here: #61100
Taking the following:
-i "pandas.Timestamp.max PR02" \
-i "pandas.Timestamp.min PR02" \
-i "pandas.Timestamp.resolution PR02" \