Repository: pandas-dev/pandas

Issue:
DOC/BLD: attributes initialized as None not picked up by autosummary anymore
I already mentioned it here: https://github.com/pydata/pandas/issues/5899#issuecomment-32967854, but then this did not appear on the dev doc builds on the website and only locally on my computer. But now I also see it there. See eg http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.html#pandas.DataFrame in the list of attributes, the `is_copy` is no link anymore.

So I get the following warning: `DataFrame.is_copy.rst:: WARNING: document isn't included in any toctree` for 8 methods:

```
pandas.DataFrame.is_copy
pandas.DatetimeIndex.name
pandas.DatetimeIndex.offset
pandas.Index.asi8
pandas.Index.name
pandas.Panel.is_copy
pandas.Panel4D.is_copy
pandas.Series.is_copy
```

Strange thing is, there have not been recent changes to these functions (I think), but the errors only appeared recently. 
@y-p You did the most recent doc build on the website? (does this not happen automatically anymore?)



Discussion:
yes I did and no it doesn't, we don't know why.

@jorisvandenbossche, are you familiar with `git bisect`?

Not yet, but I will try. At least first find a previous version that does not have this.

I lookes at this a couple of days ago, the original commit where you introduced _templates
already had some of these warnings.

Yes, I also tried to go back to locate the change, and noticed that even the released 0.13 and previous development versions of 0.12 have this issue If I checkout them now and run the docs. But the strange thing is, I only saw these warnings more recently in January, and never before. Also, for example the stable docs at the moment (from 0.13) don't have the issue ([stable docs Series docstring](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.html)), while the dev docs have ([dev docs Series docstring](http://pandas.pydata.org/pandas-docs/dev/generated/pandas.Series.html)).

So it seems that there is also something else apart from pandas that plays a role, but I shouldn't know what.

Correction, it _does_ appear also in the stable docs, just not for Series where I linked to above for some reason, but it does for DataFrame and Index etc. But I really thought it was not the case before (as I said in my comment https://github.com/pydata/pandas/issues/5899#issuecomment-32967854).

BTW, the links to the docs of 0.12 and 0.11 on the main website are dead.

That was _not_ fun.

And has become 'worse': http://pandas.pydata.org/pandas-docs/dev/generated/pandas.Index.html. I mean, previously it was only `name` and `asi8` in Index which had this problem, now 6 attributes. While nothing changed to the code I think.

do you have any idea what the problem is?

@jorisvandenbossche any fix on this?

Not yet. Should take some more time to investigate this, but it's no blocker for 0.14 I think (at least not for a first release candidate).


Resolving patch:
diff --git a/doc/sphinxext/numpydoc/docscrape_sphinx.py b/doc/sphinxext/numpydoc/docscrape_sphinx.py
--- 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
--- 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*'),


Test patch: