-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: DataFrame move doc from __init__ to cls #3342
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
Conversation
This commit moves the doc string to a more common location.
Thanks. For consistency's sake, we'll hold off on this until the rest of the major classes |
@y-p one approximation to what is to be regarded as 'major classes' might be looking what we find in the pandas name space: These are the classes for which doc is not directly under the class statement, below the rest of the classes. In [11]: [(k, c.__doc__) for k, c in pd.__dict__.items() if k[0].isupper() and c.__doc__ is None]
Out[11]:
[('WidePanel', None),
('SparseTimeSeries', None),
('Panel4D', None),
('SparseSeries', None),
('Timestamp', None),
('Period', None),
('Series', None),
('DateRange', None),
('NaT', None),
('Panel', None),
('TimeSeries', None),
('Int64Index', None)]
# here the ones for which __doc__ is under the class statement
In [12]: [k for k, c in pd.__dict__.items() if k[0].isupper() and c.__doc__ is not None]
Out[12]:
['SparseArray',
'Categorical',
'ExcelWriter',
'DataFrame',
'Index',
'SparseList',
'PeriodIndex',
'Factor',
'SparseDataFrame',
'Term',
'MultiIndex',
'HDFStore',
'DateOffset',
'SparsePanel',
'ExcelFile',
'TimeGrouper',
'DatetimeIndex'] I could do the same for the missing cases listed above. Wdyt? |
Yeah, that'd be good. |
The remaining cases are such that constitute pure factory classes employing new or have entirely missing doc strings. In [6]: sorted([(c.__module__, k) for k, c in pd.__dict__.items() if k[0].isupper() and c.__doc__ is None])
Out[6]:
[('pandas.core.daterange', 'DateRange'),
('pandas.core.index', 'Int64Index'),
('pandas.core.panelnd', 'Panel4D'),
('pandas.core.series', 'TimeSeries'),
('pandas.sparse.series', 'SparseTimeSeries'),
('pandas.tslib', 'NaT'),
('pandas.tslib', 'Timestamp')] |
Btw. is there a 101 around on how to activate Travis-CI for ones fork? |
Thanks. |
Pushed directly to master with some added docstrings. I believe this is your first commit to pandas. good job! 👍 |
Thanks @y-p ! ;-) |
This, in part addresses our discussion from #3337.
This PR moves the doc string from init to the more common class location.
(cf.. numpy, rest of pandas classes that have a doc string)
Besides STY / consistency this would allow for more directly accessing the doc string in a debugging (pdb) session: