-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix tseries.offsets docstrings with missing period in the summary (set 1) #144
Comments
@datapythonista - On checking with each of these, i realised there are no docstrings . Why are we getting the error as 'Summary does not end with a period' when summary is not there. |
It may be a bug in the script, feel free to open an issue and work on a PR. |
Thanks @datapythonista . will check the script and work on it. |
@bhuvanakundumani this is the problem you're dealing with: pandas-dev/pandas#27055 Would be great if you can take that issue and fix it. |
I will look into it. |
@datapythonista - Have been trying validate_docstrings.py and understand that the following piece of code for part in func_parts:
obj = getattr(obj,part) is getting the value of attribute normalize (which is False by Default). This when it is passed to pydoc.getdoc is getting us the docstring of False. Am kinda stuck here. Any pointers on how i should be proceeding with this? Thanks |
Thanks for looking into this @bhuvanakundumani. After that is executed, a https://github.com/pandas-dev/pandas/blob/master/scripts/validate_docstrings.py#L296 It's likely that the problem is in that function. |
@datapythonista - On inspecting the code here - I think the code in this snippet - class Docstring:
def __init__(self, name):
self.name = name
obj = self._load_obj(name)
self.obj = obj
self.code_obj = self._to_original_callable(obj)
self.raw_doc = obj.__doc__ or ""
self.clean_doc = pydoc.getdoc(obj)
self.doc = NumpyDocString(self.clean_doc) I think this line of code self.clean_doc = pydoc.getdoc(obj) should be self.clean_doc = pydoc.getdoc(self.code_obj) I tried the change and it reports the error - "No summary found (a short summary in a single line should be " (SS01) for pandas.tseries.offsets instead of "Summary does not end with a period". However , i want to make sure this fix is right ? Are there any other tests that i have to do to ensure that the change is not breaking something else? Thanks |
I think the change you propose will cause that properties and wrapped objects lose their docstring for the validation. Not sure if I think the change to fix it should happen inside Another useful test when we fix this would be to generate the json report for all docstrings with |
Thanks @datapythonista . Will look into the tests and get back to you. |
Same as #132 but for the next docstrings:
pandas.tseries.offsets.DateOffset.normalize: Summary does not end with a period
pandas.tseries.offsets.BusinessDay.normalize: Summary does not end with a period
pandas.tseries.offsets.BusinessHour.normalize: Summary does not end with a period
pandas.tseries.offsets.CustomBusinessDay.normalize: Summary does not end with a period
pandas.tseries.offsets.CustomBusinessHour.normalize: Summary does not end with a period
pandas.tseries.offsets.MonthOffset.normalize: Summary does not end with a period
pandas.tseries.offsets.MonthEnd.normalize: Summary does not end with a period
pandas.tseries.offsets.MonthBegin.normalize: Summary does not end with a period
pandas.tseries.offsets.BusinessMonthEnd.normalize: Summary does not end with a period
pandas.tseries.offsets.BusinessMonthBegin.normalize: Summary does not end with a period
pandas.tseries.offsets.CustomBusinessMonthEnd.normalize: Summary does not end with a period
pandas.tseries.offsets.CustomBusinessMonthBegin.normalize: Summary does not end with a period
pandas.tseries.offsets.SemiMonthOffset.normalize: Summary does not end with a period
pandas.tseries.offsets.SemiMonthEnd.normalize: Summary does not end with a period
pandas.tseries.offsets.SemiMonthBegin.normalize: Summary does not end with a period
pandas.tseries.offsets.Week.normalize: Summary does not end with a period
pandas.tseries.offsets.WeekOfMonth.normalize: Summary does not end with a period
pandas.tseries.offsets.LastWeekOfMonth.normalize: Summary does not end with a period
The text was updated successfully, but these errors were encountered: