diff --git a/doc/source/api.rst b/doc/source/api.rst index b1c7b569c0c42..bfd1c92d14acd 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -611,7 +611,7 @@ strings and apply several methods to it. These can be acccessed like .. The following is needed to ensure the generated pages are created with the - correct template (otherwise they would be created in the Series class page) + correct template (otherwise they would be created in the Series/Index class page) .. .. autosummary:: @@ -621,6 +621,10 @@ strings and apply several methods to it. These can be acccessed like Series.str Series.cat Series.dt + Index.str + CategoricalIndex.str + DatetimeIndex.str + TimedeltaIndex.str .. _api.categorical: diff --git a/doc/sphinxext/numpydoc/docscrape_sphinx.py b/doc/sphinxext/numpydoc/docscrape_sphinx.py index ba93b2eab779d..5a582b4d03282 100755 --- a/doc/sphinxext/numpydoc/docscrape_sphinx.py +++ b/doc/sphinxext/numpydoc/docscrape_sphinx.py @@ -19,6 +19,7 @@ def __init__(self, docstring, config={}): def load_config(self, config): self.use_plots = config.get('use_plots', False) self.class_members_toctree = config.get('class_members_toctree', True) + self.class_members_list = config.get('class_members_list', True) # string conversion routines def _str_header(self, name, symbol='`'): @@ -95,7 +96,7 @@ def _str_member_list(self, name): """ out = [] - if self[name]: + if self[name] and self.class_members_list: out += ['.. rubric:: %s' % name, ''] prefix = getattr(self, '_name', '') @@ -114,11 +115,13 @@ def _str_member_list(self, name): or inspect.isgetsetdescriptor(param_obj)): param_obj = None - if param_obj and (pydoc.getdoc(param_obj) or not desc): - # Referenced object has a docstring - autosum += [" %s%s" % (prefix, param)] - else: - others.append((param, param_type, desc)) + # pandas HACK - do not exclude attributes wich are None + # if param_obj and (pydoc.getdoc(param_obj) or not desc): + # # Referenced object has a docstring + # autosum += [" %s%s" % (prefix, param)] + # else: + # others.append((param, param_type, desc)) + autosum += [" %s%s" % (prefix, param)] if autosum: out += ['.. autosummary::'] diff --git a/doc/sphinxext/numpydoc/numpydoc.py b/doc/sphinxext/numpydoc/numpydoc.py index 2bc2d1e91ed3f..0cccf72de3745 100755 --- a/doc/sphinxext/numpydoc/numpydoc.py +++ b/doc/sphinxext/numpydoc/numpydoc.py @@ -42,6 +42,10 @@ def mangle_docstrings(app, what, name, obj, options, lines, class_members_toctree=app.config.numpydoc_class_members_toctree, ) + # PANDAS HACK (to remove the list of methods/attributes for Categorical) + if what == "class" and name.endswith(".Categorical"): + cfg['class_members_list'] = False + if what == 'module': # Strip top title title_re = re.compile(sixu('^\\s*[#*=]{4,}\\n[a-z0-9 -]+\\n[#*=]{4,}\\s*'),