Skip to content
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

DOC: some hacks to get rid of warnings #11257

Merged
merged 3 commits into from
Oct 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand All @@ -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:
Expand Down
15 changes: 9 additions & 6 deletions doc/sphinxext/numpydoc/docscrape_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='`'):
Expand Down Expand Up @@ -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', '')

Expand All @@ -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::']
Expand Down
4 changes: 4 additions & 0 deletions doc/sphinxext/numpydoc/numpydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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*'),
Expand Down