Skip to content

DOC: Fix the docstring of resample in pandas/core/generic.py #22894

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
datapythonista opened this issue Sep 29, 2018 · 7 comments · Fixed by #23197
Closed

DOC: Fix the docstring of resample in pandas/core/generic.py #22894

datapythonista opened this issue Sep 29, 2018 · 7 comments · Fixed by #23197

Comments

@datapythonista
Copy link
Member

pandas docstring are expected to follow the format defined in https://pandas.pydata.org/pandas-docs/stable/contributing_docstring.html

This includes among other things:

  • There is a short description fitting in one line (there can be a longer one after that).
  • The description of the parameters, the returns section, and the see also items, starts with a capital letter and ends with a period.
  • In the Return section there is no name before the type (e.g. transformed : Series) but just the type (e.g. Series) in the first line.
  • The examples are valid PEP-8 code, and when executed, they produce the shown input.

We should make the required adjustments in the docstring of the function resample in pandas/core/generic.py.

We should validate the docstring with our validator (which does not validate all the formats, but some):

  • ./scripts/validate_docstrings.py pandas.Series.resample

And we should validate the PEP-8 of the examples (note that the next command will validate the PEP-8 of all examples, just make sure that none of the shown is in the function being addressed, the rest will be fixed in separate issues):

  • flake8 --doctests pandas/core/generic.py
@tonytao2012
Copy link
Contributor

tonytao2012 commented Oct 1, 2018

I can work on this!
Edit: I am no longer working on this. Sorry!

@martharobinson
Copy link

I would like to work on this

@datapythonista
Copy link
Member Author

Great, let us know if you need help @martharobinson

Now we've got few PRs from others that can help you, as they are quite similar: #22902, #22890, #22904 and #22906

@jmrr
Copy link
Contributor

jmrr commented Oct 16, 2018

Hey @datapythonista as the last person who volunteered didn't eventually open a PR I took a stab at this and made good progress during the London Python Sprints Hacktoberfest meetup, hope I didn't break any pandas etiquette here.

I have a question. The validate_docstrings script produces errors with deprecated parameters, e.g. Parameters {fill_method, limit, how} not documented. What is the policy with these parameters?

Thanks!

@datapythonista
Copy link
Member Author

datapythonista commented Oct 17, 2018

In some cases it may make sense to ping the last person who said would be working on it. But an issue to fix a docstring with no activity for two weeks seems like available to me too.

Deprecated parameters should be documented and have the sphinx directive for deprecations.

@martharobinson
Copy link

Yes, sorry life intervened and prevented me from finishing this! Sorry for not making that clear.

jmrr added a commit to jmrr/pandas that referenced this issue Oct 17, 2018
* First iteration over some validation errors on pandas.Series.resample.

* Fix multi-line examples issue.
jmrr added a commit to jmrr/pandas that referenced this issue Oct 17, 2018
Not too sure they were deprecated from v0.18.0. Need to point this out in the PR.
jmrr added a commit to jmrr/pandas that referenced this issue Oct 17, 2018
jmrr added a commit to jmrr/pandas that referenced this issue Oct 17, 2018
@jmrr
Copy link
Contributor

jmrr commented Oct 18, 2018

Raised #23197. Some of the CI tests were failing, particularly re: py27, should I also fix these before the review?

jmrr added a commit to jmrr/pandas that referenced this issue Oct 27, 2018
jmrr added a commit to jmrr/pandas that referenced this issue Nov 7, 2018
jmrr added a commit to jmrr/pandas that referenced this issue Nov 7, 2018
jmrr added a commit to jmrr/pandas that referenced this issue Nov 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants