Assume that you have multiple classes and generate documentation using Sphinx. Instead of writing:
ReverseRecallCommandLines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: ReverseRecallCommandLines
:members:
:special-members:
:exclude-members: __dict__,__weakref__
ScratchPadCommandLines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: ScratchPadCommandLines
:members:
:special-members:
:exclude-members: __dict__,__weakref__
SerialRecallCommandLines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: SerialRecallCommandLines
:members:
:special-members:
:exclude-members: __dict__,__weakref__
you can define:
autodoc_default_options = {
'members': None, # Include all members (methods).
'special-members': None,
'exclude-members': '__dict__,__weakref__' # Exclude "standard" methods.
}
in conf.py.
That will enable to simplify the above code to:
ReverseRecallCommandLines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: ReverseRecallCommandLines
ScratchPadCommandLines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: ScratchPadCommandLines
SerialRecallCommandLines
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: SerialRecallCommandLines
Question: is there a similar way to inject "defaults" to automodules, which will enable something like this:
Stacked Attention Networks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: miprometheus.models.vqa_baselines.stacked_attention_networks
MAC
~~~~~~~~~~~~~~~~
.. automodule:: miprometheus.models.mac