Loader

YAML configuration loaders.

Translates human-editable YAML files into models instances. Default paths resolve to the config/ directory bundled with the package; pass explicit paths to use custom definitions.

circuitgenome.synthesizer.loader.load_modules(path=None)[source]

Load module variant definitions from a YAML file.

Parameters:

path (str | Path | None) – Path to a modules YAML file. Defaults to the built-in opamp_modules.yaml.

Returns:

Dictionary mapping category name → list of ModuleVariant.

Return type:

dict[str, list[ModuleVariant]]

Example:

from circuitgenome.synthesizer.loader import load_modules

modules = load_modules()
for variant in modules["input_pair"]:
    print(variant.name, variant.display_name)
circuitgenome.synthesizer.loader.load_bias_legs(path=None)[source]

Load the typed bias-leg library from a YAML file.

Parameters:

path (str | Path | None) – Path to a bias-legs YAML file. Defaults to the built-in bias_legs.yaml.

Returns:

A BiasLegLibrary with the master reference, the pref branch, and one leg template per rail kind (see the YAML header for the contract).

Return type:

BiasLegLibrary

circuitgenome.synthesizer.loader.load_topologies(path=None)[source]

Load topology templates from a YAML file.

Parameters:

path (str | Path | None) – Path to a topologies YAML file. Defaults to the built-in opamp_topologies.yaml.

Returns:

List of TopologyTemplate.

Return type:

list[TopologyTemplate]

Example:

from circuitgenome.synthesizer.loader import load_topologies

for topo in load_topologies():
    print(topo.name, topo.config)