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
autosummary not listing attributes #4534
Comments
This similar to an old issue: #3257 |
I guess #4247 resolved this issue. Could you try 1.70b2 please? |
This is an improvement: class variables and properties are now showing up in the attributes list. But autoclass and autosummary are still showing different lists of attributes, and the list of attributes of autosummary is incomplete, because it misses out instance attributes which are included by autoclass. Might have something to do with what daphtdazz says the the answer here https://stackoverflow.com/questions/29902483/how-can-i-get-sphinx-autosummary-to-display-the-docs-for-an-instance-attributes |
oh, sorry. I must study about autosumary... (I'm not good at it) |
Thanks for your work on autosummary here and elsewhere! Do you have a time estimate for including instance attributes in the autosummary attributes similarly to autoclass? I might be able to submit a PR for this (or find someone to help!) if it is not going to interfere with what you are doing. |
Unfortunately, I don't have time for it now. So PR is welcome! |
Hello, I ran into the same issue. Is there a chance that this is going to be fixed soon? Otherwise I will need to look for an alternative to autosummary. Edit: I just found this PR that seems to fix this issue: #9146. If that's the case it should get referenced here. |
Subject: autosummary not listing attributes
Problem
On 1.6.6, when a class is included in an autosummary list witht the
:toctree:
option set, the generated page does not have an attribute list. Class, instance and property attributes are all missing despite being present if autoclass is used.To me, it's a bug that autoclass and autosummary behave differently with respect to what items they document, and it's also a bug the the autosummary list of attributes is incomplete/missing. The lists of attributes shown by default should be the same, and complete. The solution to the bug would be that both directives show all documented attributes of all types, as autoclass currrently does (in particular, instance attributes should be included along with the others).
there's also the minor issue that instance variables get displayed with the default
None
in autoclass. There it can be overidden, if they do get included in autosummary, this would need ot be handled automaticallyProcedure to reproduce the problem
A minimal sphinx setup (included below) can be used to reproduce this. The files provided in the gz are the
conf.py
file, an editedindex.rst
file invoking autosummary and autoclass, and a minimal example module containing a test class with class, instance and property attributes,test_mod.py
. In this conf.py the only changes are that'sphinx.ext.autosummary', 'sphinx.ext.autodoc', 'sphinx.ext.napoleon'
have been added to extension andautosummary_generate = true
has been set. To reproduce runsphinx-quickstart
, use the three files given here in the created directory, and runError logs / results
the resulting autosummary and autoclass output:
The page generated by autosummary:
By changing the autosummary class template it's also possible to see that the autosummary template variable {{ attributes }} is an empty list.
Expected results
the last picture above should have an attributes list similar to the methods list including all the attributes listed in the autoclass output.
Reproducible project / your project
autosummary_bug.tar.gz
Environment info
(NB: I think that on 1.4.8 autosummary used to show the class and property attributes but not the instance ones, which was also a bug if you agre with what I said above).
The text was updated successfully, but these errors were encountered: