Skip to content

DOC: Make _field_accessor manage the docstring format #24068

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 Dec 3, 2018 · 2 comments · Fixed by #24099
Closed

DOC: Make _field_accessor manage the docstring format #24068

datapythonista opened this issue Dec 3, 2018 · 2 comments · Fixed by #24099
Labels
Code Style Code style, linting, code_checks Docs good first issue
Milestone

Comments

@datapythonista
Copy link
Member

We started to validate the formats of docstrings. For example, we expect that the summary of the docstring starts in the next line of the opening """ (see #24059).

In some cases the docstrings are generated dynamically, and in the case of _field_accessor, we have to write some line breaks to avoid the validation to fail, for example:

_field_accessor('year', 'Y', "\n The year of the datetime\n")

In this issue we should update the code of _field_accessor, and modify the calls to it removing the line breaks, so the previous example becomes:

_field_accessor('year', 'Y', 'The year of the datetime')

And the docstring is composed in a way that follows our docstring standards. The standards can be checked with:

$ ./scripts/validate_docstrings.py --prefix=pandas.Series --errors=GL01,GL02

which, it should report no error (or if it reports cases that are not fixed yet, the number of errors should decrease or not increase after the change).

@charlesdong1991
Copy link
Member

would like to fix this \n mistake i made beforehand if you don't mind...

@datapythonista
Copy link
Member Author

Not sure I understand. Your previous PR was good, it's better to fix this separate from all the other changes. And as it has already been merged, it can't be changed (if you push to your branch, nothing will be updated or happen)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks Docs good first issue
Projects
None yet
3 participants