Hi, sorry, but I don't think that's true? For instance, the header "Parameters" *does* appear in functions and class methods. Plus, in the documentation: https://github.com/sphinx-contrib/napoleon#docstring no distinction is made between these two types of headers, so why the "Attributes" header should be treated differently than "Parameters"?
Anyway, thanks for your input. Nicolas On Monday, 6 May 2019 15:03:58 UTC+2, Komiya Takeshi wrote: > > Hi Nicolas, > > It seems napoleon does not output Attribute headers ever even if > specified. It seems intended behavior. > > Thanks, > Takeshi KOMIYA > > 2019年4月22日(月) 23:33 Nicolas Chopin <[email protected] <javascript:>>: > > > > Dear list, > > I use the napoleon extension to parse my "numpy-style" docstrings. It > works great for functions, but for classes, I have the following problem. > The "Attributes" section list the attributes (as it should), but the header > "Attributes" does not show. For instance, I get this: > > > https://particles-sequential-monte-carlo-in-python.readthedocs.io/en/latest/_autosummary/particles.smoothing.ParticleHistory.html#particles.smoothing.ParticleHistory > > > (shortened url: https://bit.ly/2IyxR1F) > > > > where X, A, etc are attributes of this class ParticleHistory. You can > click on [source] to see how the class is defined; or more simply see below > for a simplified version. > > Am I doing something wrong? This page: > > https://sphinxcontrib-napoleon.readthedocs.io/en/latest/ > > says that Attributes is a supported header. > > > > I'm using sphinx 1.8.2 on Ubuntu 18.04. > > Many thanks in advance > > Nicolas > > > > > > class History(object): > > """Stores history. > > > > Blah, blah, blah. > > > > Attributes > > ---------- > > X: list > > X[t] is the object that represents the N particles at iteration > t > > A: list > > A[t] is the vector of ancestor indices at time t > > > > """ > > > > def __init__(self, N): > > """ > > Constructor. > > > > Parameters > > ---------- > > > > N: int > > number of particles > > """ > > self.N = N > > > > > > -- > > You received this message because you are subscribed to the Google > Groups "sphinx-users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > Visit this group at https://groups.google.com/group/sphinx-users. > > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sphinx-users. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/b29b0d21-850c-4d6f-9213-5e09dd6e2360%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
