experiment_runner.config
Config loading and validation for the experiment runner.
Resolves user YAML against master.yaml, applies per-method defaults,
and validates model and explainer names against the live runtime registries.
Attributes
Functions
|
Load and register external model/explainer/metric classes from the config. |
|
Resolve a user config against the master config. |
|
Check whether the supplied config contains errors. |
Module Contents
- experiment_runner.config.logger
- experiment_runner.config.register_external_components(config: dict) None
Load and register external model/explainer/metric classes from the config.
Silent extension fallback used by
config_sanity_check(): when a configured component name is absent from its runtime registry but the item suppliesclass_nameandclass_path, the class is imported from that source file and registered, so the rest of the pipeline treats it like any built-in. This lets users add components without editing package source.Gated by
general.allow_external_code(defaultFalse). If a path is supplied while the flag is off, a warning is logged and the component is left unregistered, so the subsequent validation inconfig_sanity_check()raises a clear error.- Parameters:
config (dict) – Resolved configuration dict.
- experiment_runner.config.config_resolve(user_config: dict, master_path: pathlib.Path) dict
Resolve a user config against the master config.
Steps performed:
Load master.yaml (annotated reference with all known keys and defaults).
Warn + drop any unknown top-level or nested keys found in user_config.
Fill per-item defaults for each explainer and metric from the master’s
explainers/metricslists (user keys win, gaps filled).
- Parameters:
user_config (dict) – Raw config dict as loaded from the user YAML.
master_path (Path) – Path to master.yaml.
- Returns:
Resolved config with defaults applied and unknown keys removed.
- Return type:
dict
- experiment_runner.config.config_sanity_check(config: dict) bool
Check whether the supplied config contains errors.
First registers any external components declared via
class_name/class_path(seeregister_external_components()), then validates models and explainers against the live runtime registries so that both custom entries added viaregister_model()/register_explainer()and external classes loaded from source are accepted.- Parameters:
config (dict) – Configuration to check.
- Returns:
Trueif the configuration contains no errors.- Return type:
bool