pandas
pandas copied to clipboard
DOC: fix GL08 errors in docstrings
Pandas has a script for validating docstrings:
https://github.com/pandas-dev/pandas/blob/92a52e231534de236c4e878008a4365b4b1da291/ci/code_checks.sh#L144-L415
Currently, some methods fail the GL08 check.
The task here is:
- take 2-4 methods
- run: scripts/validate_docstrings.py --format=actions --errors=GL08
method-name
- check if validation docstrings passes for those methods, and if it’s necessary fix the docstrings according to whatever error is reported
- remove those methods from code_checks.sh
- 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
I don't have permission to add them, but this could probably use some labels:
- CI
- Docs
- good first issue
addresses https://github.com/pandas-dev/pandas/pull/57360
take
working on pandas.Index.empty\ pandas.Index.names\ pandas.Index.view\
working on pandas.IntervalIndex.left\ pandas.IntervalIndex.length\ pandas.IntervalIndex.mid\
Opened a fix for
pandas.DatetimeIndex.as_unit
pandas.DatetimeIndex.freq
Working on pandas.ExcelFile.book pandas.MultiIndex.codes
Working on pandas.Timedelta.microseconds pandas.Timedelta.unit pandas.Timedelta.value
Opened a fix for pandas.core.groupby.SeriesGroupBy.value_counts
working on
pandas.IntervalIndex.right
pandas.Series.dt
I am not able to find the proper location.Can anyone help me? I was trying to add docstring for pandas.Period.freq but I am still getting the error " The object does not have a docstring ". I was trying to add docstrig to the 'freq' method for the location pandas/core/arrays/period.py.
@pmhatre1 I've had the same experience. I could not locate the correct function to add the docstring to. I've encountered this before, and my suspicion is this is something defined in .pyx
and .pyi
files and somehow the docstring is invisible to the validations run in code_checks.sh
If we could figure out a way to solve this, it would allow us to get fixes for so many of the numpy docstring errors failing validation, sadly, at this time I don't have any solution
Take pandas.Series.dt.freq\ pandas.Series.dt.unit\ pandas.Series.empty\
@pmhatre1 I've had the same experience. I could not locate the correct function to add the docstring to. I've encountered this before, and my suspicion is this is something defined in
.pyx
and.pyi
files and somehow the docstring is invisible to the validations run incode_checks.sh
If we could figure out a way to solve this, it would allow us to get fixes for so many of the numpy docstring errors failing validation, sadly, at this time I don't have any solution
I think you are right @jordan-d-murphy. Can we pull in someone here to help us?
I would love to hear some ideas from folks that might have suggestions on how to do this. @jrmylow talks about this under [DOC: fix PR02 errors in docstrings](https://github.com/pandas-dev/pandas/issues/57111) in this comment here https://github.com/pandas-dev/pandas/issues/57111#issuecomment-1929460148 maybe we can pursue this?
Hi all, if CI: speedup docstring check consecutive runs #57826 gets merged in, I might be reworking our approach here; this would look like closing the following issues:
DOC: fix GL08 errors in docstrings DOC: fix PR01 errors in docstrings DOC: fix PR07 errors in docstrings DOC: fix SA01 errors in docstrings DOC: fix RT03 errors in docstrings DOC: fix PR02 errors in docstrings
And opening a new issue to address these based on the new approach.
tl;dr
the work can still be done, but probably under a new ticket once #57826 is merged in
Closed by: CI: speedup docstring check consecutive runs #57826 CI: Better error control in the validation of docstrings #57879
Opening a new issue to fix docstring errors.
Opened DOC: Enforce Numpy Docstring Validation (Parent Issue) #58063 as a parent issue for fixing docstrings based on the refactoring in code_checks.sh
Feel free to swing by and help out! 🙂