Skip to content

DOC: Correct/update skipna docstrings for any and all (#23109) #24069

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 12 commits into from
Dec 10, 2018

Conversation

jamesmyatt
Copy link
Contributor

Also, include examples with NA values and describe treatment of NA with skipna == False

…#23109)

Also include examples with NA values and clarify treatment of NA with `skipna == False`
@pep8speaks
Copy link

pep8speaks commented Dec 3, 2018

Hello @jamesmyatt! Thanks for updating the PR.

Comment last updated on December 10, 2018 at 14:45 Hours UTC

@codecov
Copy link

codecov bot commented Dec 3, 2018

Codecov Report

Merging #24069 into master will increase coverage by 49.86%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #24069       +/-   ##
===========================================
+ Coverage   42.38%   92.25%   +49.86%     
===========================================
  Files         161      161               
  Lines       51699    51699               
===========================================
+ Hits        21913    47694    +25781     
+ Misses      29786     4005    -25781
Flag Coverage Δ
#multiple 90.65% <100%> (?)
#single 42.38% <40%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/generic.py 96.65% <100%> (+57.31%) ⬆️
pandas/core/computation/pytables.py 92.37% <0%> (+0.3%) ⬆️
pandas/io/pytables.py 92.3% <0%> (+0.92%) ⬆️
pandas/util/_test_decorators.py 93.24% <0%> (+4.05%) ⬆️
pandas/compat/__init__.py 58.36% <0%> (+8.17%) ⬆️
pandas/core/config_init.py 99.24% <0%> (+9.84%) ⬆️
pandas/core/reshape/util.py 100% <0%> (+11.53%) ⬆️
pandas/compat/numpy/__init__.py 92.85% <0%> (+14.28%) ⬆️
pandas/core/computation/common.py 85.71% <0%> (+14.28%) ⬆️
pandas/core/api.py 100% <0%> (+14.81%) ⬆️
... and 120 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 a7bb972...df91bcb. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 3, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24069      +/-   ##
==========================================
+ Coverage   92.21%   92.21%   +<.01%     
==========================================
  Files         162      162              
  Lines       51721    51723       +2     
==========================================
+ Hits        47692    47694       +2     
  Misses       4029     4029
Flag Coverage Δ
#multiple 90.61% <100%> (-0.01%) ⬇️
#single 43.03% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/generic.py 96.65% <100%> (ø) ⬆️
pandas/core/frame.py 96.91% <0%> (ø) ⬆️
pandas/core/arrays/datetimes.py 98.56% <0%> (ø) ⬆️
pandas/io/pytables.py 92.31% <0%> (ø) ⬆️

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 0ac1197...3282143. Read the comment docs.

@jreback jreback added the Docs label Dec 4, 2018
@jreback jreback added this to the 0.24.0 milestone Dec 4, 2018
@jreback
Copy link
Contributor

jreback commented Dec 4, 2018

pls also merge master. ping on green.

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

@jreback
Copy link
Contributor

jreback commented Dec 5, 2018

can you also merge master

@jamesmyatt
Copy link
Contributor Author

@jreback , will do as soon as I've made the outstanding changes.

Do you have any views on the comments above?

@datapythonista datapythonista self-assigned this Dec 7, 2018
@datapythonista
Copy link
Member

@jamesmyatt, added a comment (sorry for the delay), let me know if you need any other information to finish this PR

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, thanks @jamesmyatt. Couple of minor things. Also, would be good if you can change the return section to simply %(name1)s or %(name2)s, and in the next line indented, if you can add a short description of what is returned, that would be great.

@jamesmyatt
Copy link
Contributor Author

@jreback , @datapythonista , I think this should be ready now. 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 two small things. Also, did you run ./scripts/validate_docstrings.py pandas.Series.any and same for all, to see there are no errors?

@@ -10596,11 +10607,12 @@ def _doc_parms(cls):
DataFrame.all : Return whether all elements are True over requested axis.
"""

_any_desc = """\
Return whether any element is True over requested axis.
_any_doc = """\
Copy link
Member

Choose a reason for hiding this comment

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

I guess you changed the name to be consitent with the all, but it should be the other way round, this should be named _any_summary (or _any_desc). For the convention we use _any_doc should be the whole docstring of the any method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I did wonder if that was the right way round. I'll change them both to _desc.

I also considered moving the any variables to be close to the all and _bool_doc ones. What do you think?

@jamesmyatt
Copy link
Contributor Author

jamesmyatt commented Dec 9, 2018

Thanks, @datapythonista .

I haven't been able to run validate_docstrings.py because I can't build pandas yet: I'm using Windows and I installed the C compiler yet. Although, I have checked the new examples manually: https://gist.github.com/jamesmyatt/8c6aa9178346e25e3175500672714ca5

BTW, it's a bit annoying that the contributing guide linked from README doesn't match what's in master: I had lots of trouble with the environment files for a little while.

@datapythonista
Copy link
Member

The contributing guide you are using is for stable, which means 0.23.4.

The one corresponding to master is the one in the devs docs: https://pandas-docs.github.io/pandas-docs-travis/contributing.html

It could make sense to somehow "hide" the one for master, and have a link for the devs, as it's probably the only relevant one. How to do this is probably not trivial. But creating an issue, and may be a PR if you have an idea on how to address that, would be useful.

@jamesmyatt
Copy link
Contributor Author

jamesmyatt commented Dec 10, 2018

I've run ./scripts/validate_docstrings.py pandas.Series.any and all now and fixed the errors.

Turns out it's not so hard to install the compiler for Windows these days. I'll suggest an improvement to contributing.rst later.

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 @jamesmyatt

@jreback
Copy link
Contributor

jreback commented Dec 10, 2018

thanks. ping on green.

@jamesmyatt
Copy link
Contributor Author

@jreback , ping.

There are 2 warnings in PublishTestResults, which I assume is nothing to do with this.

@jreback jreback merged commit 5389987 into pandas-dev:master Dec 10, 2018
@jreback
Copy link
Contributor

jreback commented Dec 10, 2018

thanks!

@jamesmyatt jamesmyatt deleted the bugfix/23109 branch December 17, 2018 15:10
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
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.

BUG: skipna parameter in series.any() returns wrong result
4 participants