Skip to content

DOC: Fixes to docstrings, mainly PR09 errors #29530

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

Closed
wants to merge 53 commits into from

Conversation

HughKelley
Copy link
Contributor

@HughKelley HughKelley commented Nov 10, 2019

closes #28602

@pep8speaks
Copy link

pep8speaks commented Nov 10, 2019

Hello @HughKelley! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2019-12-31 19:55:57 UTC

@jreback jreback added the Docs label Nov 11, 2019
@jreback jreback added this to the 1.0 milestone Nov 11, 2019
@jreback
Copy link
Contributor

jreback commented Nov 11, 2019

does this completely close #28602?

@HughKelley
Copy link
Contributor Author

does this completely close #28602?

yes, after merging, running python ./scripts/validate_docstrings.py --errors=PR09 should not return any errors and we can add that error to the CI checks (Which I'd like to try to make a PR for if it's alright).

@HughKelley HughKelley closed this Nov 11, 2019
@HughKelley HughKelley reopened this Nov 11, 2019
@HughKelley
Copy link
Contributor Author

hit the wrong button in the comment dialogue and closed by accident

@datapythonista datapythonista changed the title Pr09 batch 5 DOC: Fixes to docstrings, mainly PR09 errors Nov 11, 2019
@datapythonista
Copy link
Member

@HughKelley in ci/code_checks.sh we validate that errors in docstrings don't have. Can you add PR09 to the list of errors we check, if this is the last batch. This way future changes to docstrings won't add new PR09 errors (the CI will fail).

@datapythonista
Copy link
Member

Ups, just seen your previous comment now. Please better add the check here.

Copy link
Member

@jorisvandenbossche jorisvandenbossche 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 working on this! I think a few of the changes in the indentation of "deprecated" is not correct, for the rest looks good!

@@ -82,7 +82,7 @@
* If None, then parse all columns.
* If int, then indicates last column to be parsed.

.. deprecated:: 0.24.0
.. deprecated:: 0.24.0
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this change is fully correct, as the "deprecated" notion is specific to this bullet item, not to the general keyword

(the same might be true for the other occurrences here)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, thanks for reviewing. While i agree that it would be better to have the warning indented, that breaks the validation, raising error PR09 description should end in . I have experimented with different amounts of indentation but this is the only one that doesn't raise a warning.

The way the docs render without the two spaces, seen below, I think are sufficiently clear about what the warning is referring to but I'm open to other solutions. I just haven't found any.

Screenshot_2019-11-12_10-02-53

Copy link
Member

Choose a reason for hiding this comment

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

While i agree that it would be better to have the warning indented, that breaks the validation, raising error PR09 description should end in .

Then I would consider that a bug in the validation script that could be fixed instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe @datapythonista can speak to exactly what is being worked on in the checks, I know there are some changes in the works to handle bulleted lists without leading text.

@datapythonista
Copy link
Member

That's a false positive, and I think it's fixed in the numpydoc version of our script. I expect to have the PR that replaces our script by the numpydoc version in few days, so don't worry about those errors, you can leave the docstrings correct.

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Nov 19, 2019

@HughKelley seems something went wrong with your latest update with master (there are too many commits included here, giving a big diff).

Normally something like

git checkout PR09_batch_5
git fetch upstream
git merge upstream/master
git push origin PR09_batch_5

should do the trick

@HughKelley
Copy link
Contributor Author

something went wrong with your latest update with master

definitely. I used rebase instead of merge.

I think I'm going to close this PR since it's a mess, cherrypick what I need into a new branch and open a new PR once the CI checks are all passing.

Unless you'd rather I do something else.

Thanks for the help/patience as I figure this stuff out.

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Nov 19, 2019

I think that the snippet I posted should still be able to clean it up (even after the rebase), but if that doesn't work out, no problem in creating a clean branch / PR!
(BTW, you can actually create a new branch locally but still push to this remote branch name / update this PR, you only then need to force push)

@datapythonista
Copy link
Member

The first section in this post describes what I'd do: https://datapythonista.github.io/blog/useful-git-commands.html

@HughKelley
Copy link
Contributor Author

@datapythonista @jorisvandenbossche these checks are green.

Joris, the indentation error you pointed out is fixed.

Am I responsible for resolving the merge conflict? Should I update the PR with the most recent changes to master and let the checks run again?

Thanks!

@datapythonista
Copy link
Member

Yes, you need to resolve the conflicts before we can merge. git fetch upstream and git merge upstream/master should get the conflicts locally, so you can fix them. Thanks!

@HughKelley
Copy link
Contributor Author

will do, thanks

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.

@@ -286,7 +286,7 @@ fi
### DOCSTRINGS ###
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA01, SA02, SA03, SA05)' ; echo $MSG
MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS04, SS05, PR03, PR04, PR05, PR09, PR10, EX04, RT01, RT04, RT05, SA01, SA02, SA03, SA05)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA01,SA02,SA03,SA05
Copy link
Member

Choose a reason for hiding this comment

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

you should add the error you fixed here too, the previous is only a message for the log


.. versionadded:: 0.24.0
.. versionadded:: 0.24.0
Copy link
Member

Choose a reason for hiding this comment

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

did you check if the html version of this docstring looks good? those indentations are always tricky

Copy link
Member

Choose a reason for hiding this comment

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

This is correct (it has the same indentation as the list item)

@HughKelley
Copy link
Contributor Author

@datapythonista thanks for reviewing. The checks do not pass as there are still PR09 errors in the code.

Has the update to the numpydoc script occured yet? Is there an open issue or PR for that I can keep an eye on?

The script doesn't recognize the . at the end of the description of method in pandas.DataFrame.corr.

@datapythonista
Copy link
Member

I've been working in using the numpydoc script, but there is still work to do, and I'm travelling, so it'll take some rhinestone to be ready.

We can merge this in the meantime, but you should undo the changes to the comment in code_checks. sh.

Also, please have a look at what is broken in the CI, so we can merge.

Thanks!

@@ -7140,17 +7142,16 @@ def corr(self, method="pearson", min_periods=1):
Parameters
----------
method : {'pearson', 'kendall', 'spearman'} or callable
Method of correlation:

Method of correlation.
Copy link
Member

Choose a reason for hiding this comment

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

You need to keep the blank line between the first sentence and the bullet points (I think that's the reason sphinx is complaining).

BTW, I think the colon (:) also makes sense to keep before a bullet point list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yup, thanks. That was just me playing with it to see if I could get the validation to accept it

@datapythonista
Copy link
Member

@HughKelley do you have time to address the last comments, so we can get this merged? Thanks!

@HughKelley
Copy link
Contributor Author

@HughKelley do you have time to address the last comments, so we can get this merged? Thanks!

@datapythonista

Thanks for following up. Sorry this wasn't more of a priority for me during the holidays.

i'm actually cherry picking stuff into a new (cleaner) PR that I'll get merged in the new year.

thanks very much for everyone's work on the package and helping me as i learn this stuff.

@HughKelley HughKelley closed this Dec 31, 2019
@HughKelley HughKelley deleted the PR09_batch_5 branch January 6, 2020 16:46
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: Docstrings Formatting Error PR09
5 participants