Skip to content

DOC: Fix docstrings lack of punctuation #28031

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

Conversation

martinagvilas
Copy link
Contributor

@martinagvilas martinagvilas commented Aug 20, 2019

Similar to issue #27979, and as pointed out by @datapythonista, the summaries of some dosctrings don’t end with a period.

I added the period to the following cases:

•       pandas.IndexSlice
•	pandas.MultiIndex.names
•	pandas.MultiIndex.is_lexsorted
•	pandas.MultiIndex.reorder_levels
•	pandas.DatetimeIndex.snap
•	pandas.DatetimeIndex.to_perioddelta
•	pandas.DatetimeIndex.to_pydatetime
•	pandas.DatetimeIndex.to_series
•	pandas.TimedeltaIndex
•	pandas.PeriodIndex.is_leap_year
•	pandas.api.extensions.ExtensionArray._concat_same_type
•	pandas.api.extensions.ExtensionArray.dropna

These are the outputs of validate_docstrings.py when evaluating each case:

pandas.IndexSlice

4 Errors found:
	Examples do not pass tests
	flake8 error: E231 missing whitespace after ',' (4 times)
	flake8 error: E902 TokenError: EOF in multi-line statement
	flake8 error: E999 SyntaxError: invalid syntax
1 Warnings found:
	No extended summary found

pandas.MultiIndex.names

3 Warnings found:
	No extended summary found
	See Also section not found
	No examples section found

pandas.MultiIndex.is_lexsorted

1 Errors found:
	Return value has no description
3 Warnings found:
	No extended summary found
	See Also section not found
	No examples section found

pandas.MultiIndex.reorder_levels

2 Errors found:
	Parameters {order} not documented
	Return value has no description
3 Warnings found:
	No extended summary found
	See Also section not found
	No examples section found

pandas.DatetimeIndex.snap

2 Errors found:
	Parameters {freq} not documented
	Return value has no description
3 Warnings found:
	No extended summary found
	See Also section not found
	No examples section found

pandas.DatetimeIndex.to_perioddelta

5 Errors found:
	Summary should fit in a single line
	Parameters {**kwargs, *args} not documented
	Unknown parameters {freq}
	Parameter "freq" has no description
	Return value has no description
2 Warnings found:
	See Also section not found
	No examples section found

pandas.DatetimeIndex.to_pydatetime

4 Errors found:
	Summary should fit in a single line
	Parameters {**kwargs, *args} not documented
	The first line of the Returns section should contain only the type, unless multiple values are being returned
	Return value has no description
2 Warnings found:
	See Also section not found
	No examples section found

pandas.DatetimeIndex.to_series

2 Errors found:
	Summary should fit in a single line
	Return value has no description
2 Warnings found:
	See Also section not found
	No examples section found

pandas.TimedeltaIndex

3 Errors found:
	Summary should fit in a single line
	Parameters {dtype, verify_integrity, periods, copy, data} not documented
	Unknown parameters {periods , copy , data }
1 Warnings found:
	No examples section found

pandas.PeriodIndex.is_leap_year

3 Warnings found:
	No extended summary found
	See Also section not found
	No examples section found

pandas.api.extensions.ExtensionArray._concat_same_type

2 Errors found:
	Parameter "to_concat" has no description
	Return value has no description
3 Warnings found:
	No extended summary found
	See Also section not found
	No examples section found

pandas.api.extensions.ExtensionArray.dropna

2 Errors found:
	The first line of the Returns section should contain only the type, unless multiple values are being returned
	Return value has no description
3 Warnings found:
	No extended summary found
	See Also section not found
	No examples section found

I would be happy to also work on the other errors/warnings in this PR on another.

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, great job @martinagvilas, and thanks for taking care of those.

@jorisvandenbossche jorisvandenbossche merged commit c7ceff9 into pandas-dev:master Aug 23, 2019
@jorisvandenbossche
Copy link
Member

@martinagvilas Thanks a lot!

galuhsahid pushed a commit to galuhsahid/pandas that referenced this pull request Aug 25, 2019
galuhsahid added a commit to galuhsahid/pandas that referenced this pull request Aug 25, 2019
* master: (40 commits)
  DOC: Fix GL01 and GL02 errors in the docstrings (pandas-dev#27988)
  Remove Encoding of values in char** For Labels (pandas-dev#27618)
  TYPING: more type hints for io.formats.printing (pandas-dev#27765)
  TST: fix compression tests when run without virtualenv/condaenv (pandas-dev#28051)
  DOC: Start 0.25.2 (pandas-dev#28111)
  DOC: Fix docstrings lack of punctuation (pandas-dev#28031)
  DOC: Remove alias for numpy.random.randn from the docs (pandas-dev#28082)
  DOC: update GroupBy.head()/tail() documentation (pandas-dev#27844)
  BUG: timedelta merge asof with tolerance (pandas-dev#27650)
  BUG: Series.rename raises error on values accepted by Series construc… (pandas-dev#27814)
  Preserve index when setting new column on empty dataframe. (pandas-dev#26471)
  BUG: Fixed groupby quantile for listlike q (pandas-dev#27827)
  BUG: iter with readonly values, closes pandas-dev#28055 (pandas-dev#28074)
  TST: non-strict xfail for period test (pandas-dev#28072)
  DOC: Update whatsnew (pandas-dev#28073)
  CI: disable codecov (pandas-dev#28065)
  CI: Set SHA for codecov upload (pandas-dev#28067)
  BUG: Correct the previous bug fixing on xlim for plotting (pandas-dev#28059)
  CI: Add pip dependence explicitly (pandas-dev#28008)
  DOC: Change document code prun in a row (pandas-dev#28029)
  ...
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 2019
proost pushed a commit to proost/pandas that referenced this pull request Dec 19, 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.

3 participants