pandas icon indicating copy to clipboard operation
pandas copied to clipboard

DOC: fix GL08 errors in docstrings

Open jordan-d-murphy opened this issue 1 year ago • 2 comments

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

jordan-d-murphy avatar Feb 15 '24 21:02 jordan-d-murphy

I don't have permission to add them, but this could probably use some labels:

  • CI
  • Docs
  • good first issue

jordan-d-murphy avatar Feb 15 '24 21:02 jordan-d-murphy

addresses https://github.com/pandas-dev/pandas/pull/57360

jordan-d-murphy avatar Feb 15 '24 21:02 jordan-d-murphy

take

Mintuagarwal avatar Feb 19 '24 15:02 Mintuagarwal

working on pandas.Index.empty\ pandas.Index.names\ pandas.Index.view\

merlinymy avatar Feb 21 '24 02:02 merlinymy

working on pandas.IntervalIndex.left\ pandas.IntervalIndex.length\ pandas.IntervalIndex.mid\

j36426052 avatar Feb 21 '24 07:02 j36426052

Opened a fix for

pandas.DatetimeIndex.as_unit
pandas.DatetimeIndex.freq

jordan-d-murphy avatar Feb 22 '24 06:02 jordan-d-murphy

Working on pandas.ExcelFile.book pandas.MultiIndex.codes

thomasdamcevski avatar Feb 24 '24 13:02 thomasdamcevski

Working on pandas.Timedelta.microseconds pandas.Timedelta.unit pandas.Timedelta.value

lamdang2k avatar Feb 24 '24 22:02 lamdang2k

Opened a fix for pandas.core.groupby.SeriesGroupBy.value_counts

jordan-d-murphy avatar Feb 25 '24 06:02 jordan-d-murphy

working on

pandas.IntervalIndex.right
pandas.Series.dt

s1099 avatar Mar 05 '24 05:03 s1099

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 avatar Mar 05 '24 23:03 pmhatre1

@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

jordan-d-murphy avatar Mar 10 '24 19:03 jordan-d-murphy

Take pandas.Series.dt.freq\ pandas.Series.dt.unit\ pandas.Series.empty\

pmhatre1 avatar Mar 10 '24 21:03 pmhatre1

@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

I think you are right @jordan-d-murphy. Can we pull in someone here to help us?

pmhatre1 avatar Mar 10 '24 21:03 pmhatre1

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?

jordan-d-murphy avatar Mar 10 '24 21:03 jordan-d-murphy

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

jordan-d-murphy avatar Mar 17 '24 00:03 jordan-d-murphy

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! 🙂

jordan-d-murphy avatar Mar 29 '24 06:03 jordan-d-murphy