python-sprints/pandas-mentoring

Fix RangeIndex and other docstrings for missing period in summary

Opened this issue · 8 comments

Same as #132 but for other docstrings:

pandas.Categorical.dtype: Summary does not end with a period
pandas.merge_ordered: Summary does not end with a period
pandas.bdate_range: Summary does not end with a period
pandas.period_range: Summary does not end with a period
pandas.timedelta_range: Summary does not end with a period
pandas.interval_range: Summary does not end with a period
pandas.util.hash_pandas_object: Summary does not end with a period
pandas.Grouper: Summary does not end with a period
pandas.Index.memory_usage: Summary does not end with a period
pandas.Index.fillna: Summary does not end with a period
pandas.Index.dropna: Summary does not end with a period
pandas.Int64Index: Summary does not end with a period
pandas.UInt64Index: Summary does not end with a period
pandas.Float64Index: Summary does not end with a period
pandas.RangeIndex.start: Summary does not end with a period
pandas.RangeIndex.stop: Summary does not end with a period
pandas.RangeIndex.step: Summary does not end with a period

I'd like to work on this

great, thanks. Martina already opened a PR in pandas for a similar issue. I'm sure you know how to take care of this, but you can take care at what she did if that helps.

sure . will look into it as well.

@datapythonista - have trouble with the following -

pandas.Int64Index: Summary does not end with a period
pandas.UInt64Index: Summary does not end with a period
pandas.Float64Index: Summary does not end with a period

The summary ends with a period. Have attached the screenshot for pandas.Int64Index here.
Screenshot 2019-08-21 at 9 05 00 AM

I tried running validate_docstrings.py to see if it had been fixed. It gives the error messages -
7 Errors found:
Summary does not end with a period
Summary should fit in a single line
Parameters {fastpath} not documented
Parameter "data" has no description
Parameter "dtype" has no description
Parameter "copy" description should finish with "."
Parameter "name" description should finish with "."
1 Warnings found:
No examples section found
Am i missing something here?

Could it be that in the cases that you mention the summary in the code ends with %(extra)s? This could make validate_docstrings.py throw an error.

I haven't seen this happening before. May be it's what @martinagvilas mention.

When you run the validate_docstrings.py script, the script will print the docstring that is analyzed, that should help. You can also debug (add some print to the script locally) to see what is the value of the summary... If the script is wrong, you can open an issue about it, and work on a PR.

Thanks!

It might be because the first sentence does not end on the first line (" Summary should fit in a single line" is another error listed in the output). It might be that you can't fix the period one without fixing the other (due to how the validation script works)

Will look into the script