plasmapy_sphinx.automodsumm.core
This module contains the functionality used to define the automodsumm
directive and its supporting configuration values.
automodsumm Directive
- .. automodsumm::
The
automodsummdirective is a wrapper on Sphinx’sautosummarydirective and, as such, all the options forautosummarystill work. The difference, whereautosummaryrequires a list of all the objects to document,automodsummonly requires the module name and then it will inspect the module to find all the objects to be documented according to the listed options.The module inspection will respect the
__all__dunder if defined; otherwise, it will inspect all objects of the module. The inspection will only gather direct sub-modules and ignore any 3rd party objects, unless listed in__all__.The behavior of
automodsummcan additionally be set with the configuration values described below.- :groups:
When a module is inspected all the identified objects are categorized into groups. The built-in groups are:
modules
Direct sub-packages and modules.
classes
Python classes. (excluding exceptions and warnings)
exceptions
Classes that inherit from
BaseException. (excluding warnings)warnings
Classes that inherit from
Warning.functions
Objects that satisfy
inspect.isroutine().variables
All other objects.
In addition to the built-in groups, groups defined in
automodapi_custom_groupswill be categorized. When objects are collected and grouped the modules will be done first, followed by any custom group, and, finally, the built-in groups. By default, all groups will be included in the generated table.Using the
plasmapy_sphinx.automodsumm.coremodule as an example, the module’s API shows it is made of classes and functions. So the following yields,.. automodsumm:: plasmapy_sphinx.automodsumm.core or .. automodsumm:: plasmapy_sphinx.automodsumm.core :groups: all
Automodsumm(name, arguments, options, ...)The class that defines the
automodsummdirective.AutomodsummOptions(app, modname, options[, ...])Class for advanced conditioning and manipulation of option arguments for
plasmapy_sphinx.automodsumm.core.Automodsumm.option_str_list(argument)An option validator for parsing a comma-separated option argument.
setup(app)Sphinx
setup()function for theautomodsummfunctionality.However, if you only want to collect classes then one could do
.. automodsumm:: plasmapy_sphinx.automodsumm.core :groups: classes
Automodsumm(name, arguments, options, ...)The class that defines the
automodsummdirective.AutomodsummOptions(app, modname, options[, ...])Class for advanced conditioning and manipulation of option arguments for
plasmapy_sphinx.automodsumm.core.Automodsumm.If you want to include multiple groups, then specify all groups as a comma separated list.
.. automodsumm:: plasmapy_sphinx.automodsumm.core :groups: classes, functions
- :exclude-groups:
This option behaves just like
automodsumm:groupsexcept you are selectively excluding groups for the generated table. Using the same example as before, a table of just classes can be generated by doing.. automodsumm:: plasmapy_sphinx.automodsumm.core :exclude-groups: functions
Automodsumm(name, arguments, options, ...)The class that defines the
automodsummdirective.AutomodsummOptions(app, modname, options[, ...])Class for advanced conditioning and manipulation of option arguments for
plasmapy_sphinx.automodsumm.core.Automodsumm.
- :skip:
This option allows you to skip (exclude) selected objects from the generated table. The argument is given as a comma separated list of the object’s short name. Continuing with the example from above, lets skip
AutomodsummOptionsandsetupfrom the table... automodsumm:: plasmapy_sphinx.automodsumm.core :skip: AutomodsummOptions, setup
Automodsumm(name, arguments, options, ...)The class that defines the
automodsummdirective.option_str_list(argument)An option validator for parsing a comma-separated option argument.
- :toctree:
If you want the
automodsummtable to serve as atoctree, then specify this option with a directory pathDIRNAMEwith respect to the location of yourconf.pyfile... automodsumm:: plasmapy_sphinx.autodoc.automodapi :toctree: DIRNAME
This will signal sphinx-autogen to generate stub files for the objects in the table and place them in the directory named by
DIRNAME. This behavior respects the configuration valueautosummary_generate. Additionally,automodsummwill not generate stub files for entry that falls into the modules group (see theautomodsumm:groupsoption below), unlessautomodapi_generate_module_stub_filesis setTrue.
automodsumm Configuration Values
A configuration value is a variable that con be defined in conf.py to configure
the default behavior of related sphinx directives. The configuration values
below relate to the behavior of the automodsumm directive.
- automodapi_custom_groups
Configuration value used to define custom groups which are used by
automodapiandautomodsummwhen sorting the discovered objects of an inspected module. An example custom group definition looks likeautomodapi_custom_group = { "aliases": { "title": "Aliases", "description": "Aliases are ...", "dunder": "__aliases__", } }
where the top-level key (
"aliases") is the group name used in theautomodsumm:groupsoption,"title"defines the title text of the group heading used byautomodapi,"description"defines a brief description that will be placed after the title (item is optional and can be omitted) and"dunder"defines the name of a dunder variable (similar__all__) in the module. This dunder variable is defined at the top of the module being documented and defines a list of object names just like__all__. Theautomodapiandautomodsummdirectives will used this defined dunder to identify the objects associated with the custom group. Usingplasmapy.formulary.speedsas an example, the aliases group can now be collected and displayed like.. automodsumm:: plasmapy.formulary.speeds :groups: aliases
cs_(T_e, T_i, ion[, n_e, k, gamma_e, gamma_i, Z])Alias to
ion_sound_speed.va_(B, density[, ion, mass_numb, Z])Alias to
Alfven_speed.vth_(T, particle[, method, mass, ndim])Alias to
thermal_speed().vth_kappa_(T, kappa, particle[, method, ...])Alias to
kappa_thermal_speed.
- automodapi_generate_module_stub_files
(Default
False) By defaultautomodsummwill not generated stub files for the modules group, even when thesphinxconfiguration value autosummary_generate is setTrue. Setting this configure variable toTruewill cause stub files to be generated for the modules group.
- autosummary_generate
Same as the
autosummaryconfiguration value autosummary_generate.
API
Classes
|
The class that defines the |
|
Class for advanced conditioning and manipulation of option arguments for |

Functions
|
An option validator for parsing a comma-separated option argument. |
|
Sphinx |