Skip to content

Commit 556b085

Browse files
DOC: hack to numpydoc to include attributes that are None (GH6100)
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.
1 parent 347b616 commit 556b085

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/sphinxext/numpydoc/docscrape_sphinx.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,13 @@ def _str_member_list(self, name):
115115
or inspect.isgetsetdescriptor(param_obj)):
116116
param_obj = None
117117

118-
if param_obj and (pydoc.getdoc(param_obj) or not desc):
119-
# Referenced object has a docstring
120-
autosum += [" %s%s" % (prefix, param)]
121-
else:
122-
others.append((param, param_type, desc))
118+
# pandas HACK - do not exclude attributes wich are None
119+
# if param_obj and (pydoc.getdoc(param_obj) or not desc):
120+
# # Referenced object has a docstring
121+
# autosum += [" %s%s" % (prefix, param)]
122+
# else:
123+
# others.append((param, param_type, desc))
124+
autosum += [" %s%s" % (prefix, param)]
123125

124126
if autosum:
125127
out += ['.. autosummary::']

0 commit comments

Comments
 (0)