admin管理员组文章数量:1435859
I have a Python package and want to generate the API documentation with the autosummary extension of sphinx.
The problem I am running into is that my main package class inherits from PyTorch's nn.Module
, and when running autosummary on my package, it tries to document all the methods in nn.Module
, which I don' want.
Is there a way to make autosummary ignore these inherited methods?
I am also using my autosummary call is as follows:
.. autosummary::
:toctree: generated/
:recursive:
my_package
My problematic class is in the module my_package.model.MyClass
.
I have tried playing with the autodoc_default_options:
autodoc_default_options = {
'members': True,
'undoc-members': False,
'private-members': False,
'special-members': False,
'inherited-members': False,
'show-inheritance': True,
'module-first': True,
}
But this didn't work.
本文标签: pythonExclude inherited class methods in sphinx autosummaryStack Overflow
版权声明:本文标题:python - Exclude inherited class methods in sphinx autosummary - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745674430a2669766.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论