rizer.spice.backend.services.config_loader#

Load circuit configurations from YAML files (STONE-inspired format).

Each YAML file defines one circuit type with its metadata and default parameters. The STONE convention uses component type names as keys (e.g. resistance_model: {Constant: {}}) and this loader converts that structure into the flat dicts expected by the Pydantic schemas and the frontend API.

Attributes#

Functions#

load_circuit_configs(→ tuple[CircuitRegistry, ...)

Scan config_dir for *.yaml files and return registry, defaults, and output labels.

Module Contents#

type rizer.spice.backend.services.config_loader.CircuitRegistry = dict[str, CircuitInfo]#
type rizer.spice.backend.services.config_loader.DefaultParams = dict[str, dict]#
type rizer.spice.backend.services.config_loader.OutputLabels = dict[str, dict[str, str]]#
rizer.spice.backend.services.config_loader.logger#
rizer.spice.backend.services.config_loader.load_circuit_configs(config_dir: str | pathlib.Path | None = None) tuple[CircuitRegistry, DefaultParams, OutputLabels]#

Scan config_dir for *.yaml files and return registry, defaults, and output labels.

Parameters:

config_dir (str or pathlib.Path, optional) – Directory containing the YAML config files. Defaults to the rizer/configs/ directory shipped with the package.

Returns:

A 3-tuple (registry, defaults, output_labels). registry maps circuit-id to CircuitInfo; defaults maps circuit-id to a flat parameter dict for the API; output_labels maps circuit-id to a dict of series_key -> label.

Return type:

tuple