python-sphinxautodocnumpydoc

disable automatic autosummary created by numpydoc


Is it possible do disable the complete autosummary when using autodoc?

I've got a class derived from a Python standard library class, which has many public methods. My custom class should work as a wrapper, directly providing methods to communicate with my device using its protocol. Therefore I only want to include a few selected inherited methods in the autosummary table.

.. autoclass:: my_module.MyClass
   :members:
   :show-inheritance:

   .. autosummary::
      my_method
      another_method

The ..autosummary:: block does exactly what I desire, but ..autoclass:: automatically creates a full methods table. Is there a way to disable this feature?


Edit (clarification)

Using the autosummary directive directly, I'm able to produce a method table containing only my_method and another_method:

.. autosummary::
   my_method
   another_method

However, when using autoclass or automodule without a following autosummary directive, I still get a method table looking exactly like the one created by the autosummary block above, only with all methods described:

.. autoclass:: my_module.MyClass
   :members:
   :show-inheritance

Edit 2

The "complete" autosummary table is being generated by numpydoc.


Solution

  • The "problem" was not inside autodoc or autosummary.
    Though not mentioned in the question I'm using numpydoc, which was generating the additional autosummary table.

    As described in numpydoc's documentation, this feature can be disabled by adding numpydoc_show_inherited_class_members = False to the sphinx conf.py.