config

Configuration loaders for generator scenarios.

pysatl_cpd.data.generator.config.scenario_from_yaml(path)[source]

Load one scenario specification from a YAML file.

Parameters:

path (str | Path) – Path to the YAML file.

Returns:

Parsed scenario specification.

Return type:

ScenarioSpec

Raises:

ValueError – If the YAML content is not a mapping.

pysatl_cpd.data.generator.config.scenarios_from_yaml(path)[source]

Load one or more scenario specifications from a YAML file.

If the YAML contains a top-level scenarios key, each entry under it is parsed as a named scenario. Otherwise the entire file is treated as a single scenario and returned under its name key.

Parameters:

path (str | Path) – Path to the YAML file.

Returns:

Dictionary mapping scenario names to parsed specifications.

Return type:

dict[str, ScenarioSpec]

Raises:

ValueError – If the YAML structure is invalid.

pysatl_cpd.data.generator.config.scenario_from_mapping(mapping)[source]

Build a scenario specification from a plain mapping.

Parameters:

mapping (Mapping[str, Any]) – Dictionary containing name, segments, and plans keys.

Returns:

Parsed scenario specification.

Return type:

ScenarioSpec

pysatl_cpd.data.generator.config.parse_distribution_spec(mapping)[source]

Build a distribution specification from a plain mapping.

Parameters:

mapping (Mapping[str, Any]) – Dictionary containing a kind key and distribution-specific parameters.

Returns:

Parsed distribution specification.

Return type:

MultivariateNormalSpec | IndependentColumnsSpec | NormalSpec | UniformSpec | ExponentialSpec | StudentTSpec

Raises:

ValueError – If kind is not one of the supported distribution types.