Skip to content

Commit

Permalink
DOC: hack to numpydoc to include attributes that are None (GH6100)
Browse files Browse the repository at this point in the history
See GH6100. Some attributes of our classes are None, even on the
class objects themselves (so not on instances). By default, numpydoc
does not include them in the autosummary table but in a separate
plain table. But, our class.rst template does include them in the
toctree autosummary, which creates docstring pages for these. This
results in warnings "WARNING: document isn't included in any toctree".
This hack to numpydoc does include them in the autosummary in the class
docstring, removing this warning.
  • Loading branch information
jorisvandenbossche committed Oct 7, 2015
1 parent 32ace13 commit 70c9d31
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions doc/sphinxext/numpydoc/docscrape_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,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

0 comments on commit 70c9d31

Please sign in to comment.