FIREQ_CLIENT.yaml_preprocessor#

Preprocessing of experiment YAML configuration files.

Functions

load_and_resolve(yaml_path)

Load a YAML file and resolve all '%...' placeholders.

resolve_placeholders(data)

Resolve the placeholders in a YAML config dict.

FIREQ_CLIENT.yaml_preprocessor.resolve_placeholders(data: dict[str, Any]) → dict[str, Any][source]#

Resolve the placeholders in a YAML config dict.

Given a dict with keys ‘preprocess’, ‘variables’, ‘sys_config’, replace all “%variable_name” placeholders in sys_config (and anywhere else) with the actual values from ‘preprocess’, then return a dict containing only ‘variables’ and the resolved ‘sys_config’.

Parameters:

data (dict[str, Any]) – raw YAML configuration.

Returns:

dict with the resolved ‘sys_config’ and the unchanged ‘variables’.

Return type:

dict[str, Any]

FIREQ_CLIENT.yaml_preprocessor.load_and_resolve(yaml_path: str) → dict[str, Any][source]#

Load a YAML file and resolve all ‘%…’ placeholders.

Parameters:

yaml_path (str) – path to the YAML file.

Returns:

dict with the resolved configuration.

Return type:

dict[str, Any]