common_arguments
Functions to define the CLI's "common" arguments, i.e. those that can be applied to either: - All module argument lists, e.g. --dataset, --seed, etc. - A subset of module(s) argument lists, e.g. --synthetic, --typed, etc.
get_core_parser(overrides=False)
Create the core common parser group applied to all modules (and the pipeline
and config
options).
Note that we leverage common titling of the argument group to ensure arguments appear together even if declared separately.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides |
whether the arguments declared within are required or not. |
False
|
Returns:
Type | Description |
---|---|
ArgumentParser
|
The parser with the group containing the core arguments attached. |
Source code in src/nhssynth/cli/common_arguments.py
get_seed_parser(overrides=False)
Create the common parser group for the seed. NB This is separate to the rest of the core arguments as it does not apply to the dashboard module.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
overrides |
whether the arguments declared within are required or not. |
False
|
Returns:
Type | Description |
---|---|
ArgumentParser
|
The parser with the group containing the seed argument attached. |
Source code in src/nhssynth/cli/common_arguments.py
suffix_parser_generator(name, help, required=False)
Generator function for creating parsers following a common template.
These parsers are all suffixes to the --dataset / -d / DATASET argument, see COMMON_TITLE
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
the name / label of the argument to add to the CLI options. |
required |
help |
str
|
the help message when the CLI is run with --help / -h. |
required |
required |
bool
|
whether the argument must be provided or not. |
False
|