Qcodes icon indicating copy to clipboard operation
Qcodes copied to clipboard

Using autodocsumm fails for inherited attributes

Open jenshnielsen opened this issue 3 years ago • 2 comments

We are using autodocsumm to generate helpful summary tables for modules classes and attributes.

However this triggers a warning and skips the member for inherited instance attributes. I bit of debugging using the most verbose setting of sphinx with $env:SPHINXOPTS = "-v -v -v " reveals the generated code for this.

It turns out that autodocsumm generates the correct code using the autosummary extension. However, this triggers a bug in sphinx https://github.com/sphinx-doc/sphinx/issues/9884

In https://github.com/QCoDeS/Qcodes/pull/4273 I have tried working around this by converting instance attributes to properties. While this is often a good solution this does not work well for Parameters that are assigned using self.myparam = Parameter(...) in instrument super classes such as the ones done in https://github.com/QCoDeS/Qcodes/pull/4371. This means that we cannot document inherited instruments using autodocsumm without a propper fix

jenshnielsen avatar Jul 16 '22 07:07 jenshnielsen

To debug this I created a project here https://github.com/jenshnielsen/debugproject doing things but without any extra dependencies

jenshnielsen avatar Jul 16 '22 07:07 jenshnielsen

Currently worked around using a fork of Sphinx. Will close when this has made it into an official release and we are using that

jenshnielsen avatar Aug 01 '22 07:08 jenshnielsen