coma.hooks.post_config_hook
Post config hook utilities, factories, and defaults.
- single_cli_override_factory(config_id: str, cli_override: typing.Callable = <function override>) Callable[[...], Dict[str, Any]] [source]
Factory for creating a post config hook that overrides a config’s attributes.
Overriding with command line arguments is achieved by calling
cli_override
, which isoverride()
by default. Slight alternatives can be created usingoverride_factory()
. Alternatively, a custom function can also be used.Example
Change separator to
"~"
:coma.initiate(..., post_config_hook=override_factory(sep="~"))
- multi_cli_override_factory(cli_override: typing.Callable = <function override>) Callable[[...], Dict[str, Any]] [source]
Factory for creating a post config hook that overrides attributes of all configs.
Equivalent to calling
single_cli_override_factory()
for each config withcli_override
passed along. Seesingle_cli_override_factory()
for details.