Skip to content

DOC: Fix docstrings with the sections in the wrong order #24280 #24288

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

Merged
merged 15 commits into from
Dec 19, 2018

Conversation

benjaminr
Copy link
Contributor

@benjaminr benjaminr commented Dec 15, 2018

@pep8speaks
Copy link

pep8speaks commented Dec 15, 2018

Hello @benjaminr! Thanks for updating the PR.

Comment last updated on December 15, 2018 at 23:46 Hours UTC

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing these @benjaminr

Can you add the validation of the error to ci/code_checks.sh. It's explained in the issue description.

@jreback jreback added the Docs label Dec 15, 2018
@codecov
Copy link

codecov bot commented Dec 15, 2018

Codecov Report

Merging #24288 into master will decrease coverage by 49.21%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #24288       +/-   ##
===========================================
- Coverage   92.22%   43.01%   -49.22%     
===========================================
  Files         162      162               
  Lines       51824    51820        -4     
===========================================
- Hits        47795    22288    -25507     
- Misses       4029    29532    +25503
Flag Coverage Δ
#multiple ?
#single 43.01% <100%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/accessor.py 63.85% <ø> (-34.94%) ⬇️
pandas/core/window.py 28.93% <100%> (-67.47%) ⬇️
pandas/core/groupby/groupby.py 24.5% <100%> (-72.17%) ⬇️
pandas/core/resample.py 22.73% <100%> (-73.85%) ⬇️
pandas/core/frame.py 35.88% <100%> (-61.03%) ⬇️
pandas/core/groupby/generic.py 13.5% <100%> (-73.63%) ⬇️
pandas/core/series.py 49.32% <100%> (-44.38%) ⬇️
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/core/categorical.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
... and 126 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b0fa8e...fd54af4. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 15, 2018

Codecov Report

Merging #24288 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24288      +/-   ##
==========================================
+ Coverage   92.28%   92.28%   +<.01%     
==========================================
  Files         162      162              
  Lines       51831    51837       +6     
==========================================
+ Hits        47830    47837       +7     
+ Misses       4001     4000       -1
Flag Coverage Δ
#multiple 90.68% <100%> (ø) ⬆️
#single 43% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/window.py 96.41% <100%> (+0.01%) ⬆️
pandas/core/groupby/generic.py 87.15% <100%> (+0.03%) ⬆️
pandas/core/series.py 93.71% <100%> (ø) ⬆️
pandas/core/groupby/groupby.py 96.65% <100%> (-0.03%) ⬇️
pandas/core/resample.py 96.58% <100%> (ø) ⬆️
pandas/core/frame.py 96.91% <100%> (ø) ⬆️
pandas/core/generic.py 96.66% <100%> (ø) ⬆️
pandas/util/testing.py 87.58% <0%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 216986d...fc5fc69. Read the comment docs.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add to ci/code_checks.sh the validation of GL07 in the call to scripts/validate_docstrings.py, so we can see that everything is correct now?

@datapythonista
Copy link
Member

Also, the errors in the CI are because there is a test comparing that the common methods of NaT and Timestamp have the same docstrings. You can see a fix to a failure in this same test here: 5c54db8

If you try to reproduce the test failure locally, note that .pyx needs to be compiled for the right docstrings to be accessed.

@datapythonista
Copy link
Member

Can you merge master too. We just merged #24132, and with this PR, all the sections should be in the right order now. When you add the check to ci/code_checks.sh we'll be sure.

…tution decorator in docstrings where commonly repeated
…ugh aggregate method docstrings still have the issue of sharing a docstring with Notes directly after Returns. This means any further appends with a See Also section are out of order.
@datapythonista
Copy link
Member

We've got this cases failing in the CI:

2018-12-16T17:17:04.7332443Z ##[error]pandas/core/series.py(3305,): error GL07: pandas.Series.agg: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7343114Z ##[error]pandas/core/series.py(3305,): error GL07: pandas.Series.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7345657Z ##[error]pandas/core/frame.py(6094,): error GL07: pandas.DataFrame.agg: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7346376Z ##[error]pandas/core/frame.py(6094,): error GL07: pandas.DataFrame.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7347044Z ##[error]pandas/core/window.py(1648,): error GL07: pandas.core.window.Rolling.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7347714Z ##[error]pandas/core/window.py(1924,): error GL07: pandas.core.window.Expanding.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7348542Z ##[error]pandas/core/groupby/generic.py(1305,): error GL07: pandas.core.groupby.DataFrameGroupBy.agg: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7349265Z ##[error]pandas/core/resample.py(256,): error GL07: pandas.core.resample.Resampler.apply: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples
2018-12-16T17:17:04.7350194Z ##[error]pandas/core/resample.py(256,): error GL07: pandas.core.resample.Resampler.aggregate: Sections are in the wrong order. Correct order is: Parameters, Returns, See Also, Notes, Examples

If they can't be fixed with the Appender the way it is, we may have to split what we are appending, of just generate the string with .format()... Do you think you can do it?

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just couple of comments

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, much better now. Just two small details, and let's see how the CI finishes, and this should be ready to be merged.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks a lot for this @benjaminr, nice fixes

@benjaminr
Copy link
Contributor Author

No problem, thanks for your patience @datapythonista :)

@jreback jreback added this to the 0.24.0 milestone Dec 19, 2018
@jreback jreback merged commit 312a8ee into pandas-dev:master Dec 19, 2018
@jreback
Copy link
Contributor

jreback commented Dec 19, 2018

thanks @benjaminr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Fix docstrings with the sections in the wrong order
4 participants