python - Exclude inherited class methods in sphinx autosummary - Stack Overflow

I have a Python package and want to generate the API documentation with the autosummary extension of sp

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745674431a4639601.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信