ska_sdp_piper.piper.configurations.runtime_config module
- class ska_sdp_piper.piper.configurations.runtime_config.RuntimeConfig(pipeline, parameters, global_parameters, version=None)[source]
Bases:
objectRuntime configuration manager for the pipeline
- Parameters:
- set(config_path, value)[source]
Updates a given key in the config
- Parameters:
Examples
>>> stage_params = { "stage1": { "param1": 10 } } >>> runtimeconfig = RuntimeConfig({"stage1": True}, stage_params, {}) >>> runtimeconfig.set("parameters.stage1.param1", 20) >>> runtimeconfig.set("pipeline.stage1", False)
- update_from_yaml(yaml_path)[source]
Updates current runtime configuration from a yaml file
- Parameters:
yaml_path (str) -- Path to the yaml configuration file
- Returns:
Same instance but with updated paramters.
- Return type:
- update_from_cli_overrides(cli_overrides)[source]
Update the runtime configuration from CLI overrides option
- Parameters:
cli_overrides (
list[tuple[str,str]]) -- A list of tuple/list, where each element contains 2 sub-elements. First element is a string key to the parameter to override. This can represent a path to a nested key, where each key in the hirerarchy is seperated by a.character. Second element is also a string, which is then parsed using YAML rules, and converted to a rich object.- Returns:
Same instance but with updated paramters
- Return type:
Examples
>>> runtimeconfig.update_from_cli_overrides( ["parameters.stage1.param1", "20"], ["pipeline.stage1", "False"], )
- update_from_cli_stages(cli_stages)[source]
Update the pipeline stage states
- Parameters:
- Returns:
Same instance but with updated paramters
- Return type: