gaps.cli.documentation.CommandDocumentation#
- class CommandDocumentation(*functions, skip_params=None, is_split_spatially=False)[source]#
Bases:
object
Generate documentation for a command.
Commands are typically comprised of one or more functions. This definition includes class initializers and object methods. Documentation is compiled from all input functions and used to generate CLI help docs and template configuration files.
- Parameters:
*functions (callables) – Functions that comprise a single command for which to generate documentation. IMPORTANT The extended summary will be pulled form the first function only!
skip_params (set, optional) – Set of parameter names (str) to exclude from documentation. Typically this is because the user would not explicitly have to specify these. By default, None.
is_split_spatially (bool, optional) – Flag indicating whether or not this function is split spatially across nodes. If True, a “nodes” option is added to the execution control block of the generated documentation. By default, False.
Methods
command_help
(command_name)Generate a help string for a command.
config_help
(command_name)Generate a config help string for a command.
param_required
(param)Check whether a parameter is required for the run function
Attributes
REQUIRED_TAG
Default "execution_control" config
Execution_control documentation
Function extended summary, without extra whitespace
Function parameter help, including execution control
Parameter help for the func
Required parameters of the input function
A template configuration file for this function
- config_help(command_name)[source]#
Generate a config help string for a command.
- Parameters:
command_name (str) – Name of command for which the config help is being generated.
- Returns:
str – Help string for the config file.