8000 DOC: some hacks to get rid of warnings by jorisvandenbossche · Pull Request #11257 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

DOC: some hacks to get rid of warnings #11257

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

Merged
merged 3 commits into from
Oct 7, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
DOC: hack to numpydoc to avoid warnings for Categorical (not includin…
…g members)

The Categorical docstring in api.rst uses a seperate template to not
include an autosummary table with toctrees of all members. But
numpydoc still includes a list by default (which will gives thousands of
warnings). This hack ensures that for Categorical class docstring this
list is not included.
  • Loading branch information
jorisvandenbossche committed Oct 7, 2015
commit cf40991093e746e5dde40fca4f322ecfc3dfff78
3 changes: 2 additions & 1 deletion 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 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
0