-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Various docstring fixes #28744
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
Various docstring fixes #28744
Conversation
Simple error fixes for idxmin and idxmax regarding their docstrings
Fixed errors on swaplevel, rename, and drop methods
Fixed methods mean, std, var, and corr in ewm.py. Fixed methods sum, apply, max, std, var, and quantile in rolling.py
Fixed functions table, scatter_matrix, radviz, bootstrap_plot, parallel_coordinates, lag_plot, and autocorrelation_plot. Noticed that functions with the @deprecate_kwarg decorator tend to not behave correctly with the tests.
Fixed the docstring for transpose, eval, swaplevel, and melt in frame.py
Caught small whitespace issues.
Fixed errors shown by automated tests (PR04 and GL03)
Oh, uh - I guess this PR re-does what mine did - plus additional stuff. No sense merging both, so looks like this one might be a superset of mine. So much for my first PR on pandas... 😞 |
Sorry, I didn't see yours until after I had committed the overlapping
changes. There's still more than a few that look like simple formatting
errors if you want to go after those. I'm going to start looking into the
issues with decorators.
Don't feel disheartened, my work wasn't any more valuable than yours.
…On Wed, Oct 2, 2019 at 11:23 AM Angela Ambroz ***@***.***> wrote:
Oh, uh - I guess this PR re-does what mine did
<#28742> - plus additional
stuff. No sense merging both, so looks like this one might be a superset of
mine. So much for my first PR on pandas... 😞
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#28744?email_source=notifications&email_token=ACT76UTP2DHUISSB4XZSH7LQMS4HVA5CNFSM4I4RUVZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAFEO3I#issuecomment-537544557>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACT76US5D7W4EIHUZ5TPTU3QMS4HVANCNFSM4I4RUVZA>
.
--
Sincerely,
*Nathan Abel*
Kettering University - Computer Science
989-780-3050
|
Fixed issues shown by automated tests with error PR03.
Thanks for the follow-up. Yeah, it's hard to find unclaimed work on these projects. (I've been looking here and on scikit-learn.) I'll take a look at the remaining stuff. 👍 |
I'm not sure why the Travis CI build failed. Could I get a pointer on how to fix it, or was the code not at fault? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for working on all those. Added some comments, all the args and kwargs should be merged, unless they really require different descriptions.
pandas/core/frame.py
Outdated
*args | ||
Additional arguments have no effect but might be accepted for | ||
compatibility with numpy. | ||
**kwargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script is wrong in this case, please revert
pandas/core/frame.py
Outdated
@@ -3237,7 +3237,7 @@ def eval(self, expr, inplace=False, **kwargs): | |||
If the expression contains an assignment, whether to perform the | |||
operation inplace and mutate the existing DataFrame. Otherwise, | |||
a new DataFrame is returned. | |||
kwargs : dict | |||
**kwargs : dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the type
pandas/core/series.py
Outdated
*args | ||
Additional arguments have no effect but might be accepted | ||
for compatability with NumPy | ||
**kwargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge those please
pandas/core/frame.py
Outdated
@@ -5205,8 +5205,10 @@ def swaplevel(self, i=-2, j=-1, axis=0): | |||
|
|||
Parameters | |||
---------- | |||
i, j : int, str (can be mixed) | |||
Level of index to be swapped. Can pass level name as string. | |||
i : int, str (can be mixed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int or str
, not sure what the can be mixed means here, but shouldn't be in the type (can be explained in the description)
pandas/core/series.py
Outdated
*args | ||
Additional arguments have no effect but might be accepted | ||
for compatibility with NumPy. | ||
**kwargs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please merge args and kwargs
pandas/core/window/ewm.py
Outdated
**kwargs | ||
Keyword arguments to be passed into func. | ||
Keyword arguments to be passed into func. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge args and kwargs
pandas/core/window/ewm.py
Outdated
output will be a MultiIndex DataFrame in the case of DataFrame | ||
inputs. In the case of missing elements, only complete pairwise | ||
observations will be used. | ||
**kwargs : dict of {str : Any} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the type
pandas/core/window/ewm.py
Outdated
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this blank line, this is probably breaking the CI
pandas/core/window/rolling.py
Outdated
*args, **kwargs | ||
args : tuple of Any | ||
Arguments and keyword arguments to be passed into func. | ||
kwargs : dict of {str : any} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the types, aren't those *args
instead of args
?
pandas/plotting/_misc.py
Outdated
@@ -398,7 +398,7 @@ def lag_plot(series, lag=1, ax=None, **kwds): | |||
series : Time series | |||
lag : lag of the scatter plot, default 1 | |||
ax : Matplotlib axis object, optional | |||
kwds : Matplotlib scatter method keyword arguments, optional | |||
**kwds : Matplotlib scatter method keyword arguments, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this to the description, no type for star params
Put args and kwargs back on the same line, since that's how the documentation should be. The validation script needs to be changed to catch this.
…rious_docstring_fixes
Hello @Nabel0721! 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-11-08 03:21:11 UTC |
Should've checked it before commiting. Two very small fixes
I'm going to start looking into fixing the validation script so it catches more of these properly, since the correct format for the docs is to have args and kwargs in the same line. |
Can't look now, but I think there is an issue for it. |
Sure, will be great to see both fixed. |
This is ready to be merged, I have the changes to the validation script in a separate pull request, since it addresses a different problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, other than that looks good
pandas/core/window/ewm.py
Outdated
*args | ||
Arguments to be passed into func. | ||
**kwargs | ||
Keyword arguments to be passed into func. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better revert this please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not resolve this and mark as resolved? I think your proposed change is incorrect, the original is more accurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea why I missed these. I'll get them right away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it looks like I just forgot to mark this as resolved. It should be fixed in the last commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason it's showing up as reverted on my machine, but not here. I'll just do the edits on Github.
Merged *args and **kwargs, removed a duplicate documentation, and removed the type for **kwargs.
Issues are fixed. Thanks for working through this with me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple of small things, but looks good besides that
pandas/core/window/ewm.py
Outdated
*args | ||
Arguments to be passed into func. | ||
**kwargs | ||
Keyword arguments to be passed into func. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not resolve this and mark as resolved? I think your proposed change is incorrect, the original is more accurate.
pandas/core/series.py
Outdated
Level of index to be swapped. Can pass level name as string. | ||
i : int, str | ||
Level of first index to be swapped. Can pass level name as string. | ||
j : int, str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int or str
in both cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and you can also merge them back
pandas/core/frame.py
Outdated
i : int or str | ||
Level of first index to be swapped. Can pass level name as string. | ||
j : int or str | ||
Level of second index to be swapped. Can pass level name as string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd merge those, I think the validation script should accept this, as proposed in the PR where you update it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now the proposed script does not validate any variables on the same line, just *args and **kwargs. I left it that way in case we decide we don't want people to just throw a bunch of variables on the same line. If you think that'd be fine, then I can rewrite the script update to allow for that, and change these here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the PR allowing having those together was merged, right? Can you have i, j
instead please
Updating to most recent version
pandas/core/frame.py
Outdated
i : int or str | ||
Level of first index to be swapped. Can pass level name as string. | ||
j : int or str | ||
Level of second index to be swapped. Can pass level name as string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the PR allowing having those together was merged, right? Can you have i, j
instead please
pandas/core/series.py
Outdated
Level of index to be swapped. Can pass level name as string. | ||
i : int, str | ||
Level of first index to be swapped. Can pass level name as string. | ||
j : int, str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
pandas/core/window/ewm.py
Outdated
*args | ||
Arguments to be passed into func. | ||
**kwargs | ||
Keyword arguments to be passed into func. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not reverted.
pandas/plotting/_misc.py
Outdated
@@ -398,7 +398,8 @@ def lag_plot(series, lag=1, ax=None, **kwds): | |||
series : Time series | |||
lag : lag of the scatter plot, default 1 | |||
ax : Matplotlib axis object, optional | |||
kwds : Matplotlib scatter method keyword arguments, optional | |||
**kwds | |||
Matplotlib scatter method keyword arguments, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the optional, and end with period.
Moved a couple of index parameters onto the same line, and redid one parameter description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice fixes, few comments
pandas/core/frame.py
Outdated
i, j : int, str (can be mixed) | ||
Level of index to be swapped. Can pass level name as string. | ||
i, j: int or str | ||
Levels indecies to be swapped. Can pass level name as string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo, indices
pandas/core/series.py
Outdated
i, j : int, str (can be mixed) | ||
Level of index to be swapped. Can pass level name as string. | ||
i, j : int, str | ||
Level of the indecies to be swapped. Can pass level name as string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same typo
pandas/core/window/ewm.py
Outdated
*args | ||
Arguments to be passed into func. | ||
**kwargs | ||
Keyword arguments to be passed into func. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert please
Added a space between a parameter and the colon.
Fixed typos on documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, couple of comments.
@Nabel0721 do you have time to commit the last changes? And next time it'd be better if you leave checked the checkbox to let maintainers commit to your branch, and we could do it ourselves. Thanks! |
I got really busy unexpectedly, so I don't think I'll have time for a couple more weeks. I do think I have the "allow edits from maintainers" checkbox on, so I'm not sure why it's showing up as off on your end. If you are able to make edits though, feel free. |
Nice PR but sounds like it is stale (or at least will be for the foreseeable future). @Nabel0721 ping if you'd like to pick this back up and can reopen |
Yeah, my apologies. I’m not going to be able to get to this for a while.
I’ll be sure to ping if there’s an update.
On Thu, Nov 7, 2019 at 7:05 PM William Ayd ***@***.***> wrote:
Closed #28744 <#28744>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28744?email_source=notifications&email_token=ACT76UWBBBVR7LTRSKCNXVDQSSUN5A5CNFSM4I4RUVZKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOUXDNNGY#event-2781271707>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACT76UTH7RIBWJPLBE77W6TQSSUN5ANCNFSM4I4RUVZA>
.
--
Sincerely,
*Nathan Abel*
Kettering University - Computer Science
989-780-3050
|
@Nabel0721 the only thing pending is literally clicking on the We can't do it ourselves (github issue, or you didn't allow maintainers to edit this PR). If you can spend one minute doing that, we can merge this changes. |
I didn't know I could do this Co-Authored-By: Marc Garcia <[email protected]>
Small change to wording Co-Authored-By: Marc Garcia <[email protected]>
Sorry, I didn't know I could do that. I would have done it a while ago if I had known. |
It must be a github issue that you can't do edits though. I checked again and the allow edits checkbox is still checked. Sorry for how long this has taken to finish up, but thank you for being patient. |
There was a problem hiding this 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 @Nabel0721 for fixing all this. Hope to see you back when you have more free time!
For sure. It's always nice to get to work on python code. |
Great thanks @Nabel0721 and @datapythonista |
xref Fix PR02 issues in docstrings #27976
tests added / passed - Didn't run all tests, only those concerning the issue (
./scripts/validate_docstrings.py pandas.Series.drop --errors=PR02
)passes
black pandas
- Only docstrings were edited, so there were no major changespasses
git diff upstream/master -u -- "*.py" | flake8 --diff
whatsnew entry- Not needed, only docs changedGeneral fixes to the documentation in different places. I discovered that the root of many of the conflicts lies in decorators. We might need to re-evaluate how we're getting the signature of functions in the validation script.
First time submitting a PR! Let me know if I need to do anything, or if there's anything I should do differently next time :)