eta_ctrl.config.config module

class eta_ctrl.config.config.Config(*, root_path: Path, config_file_relpath: Path, paths: ConfigPaths = <factory>, setup: ConfigSetup, settings: ConfigSettings)[source]

Bases: BaseModel

Configuration for the optimization, which can be loaded from a JSON, TOML, or YAML file.

Holds the config name and path configuration, remaining data is split up in ConfigSetup and ConfigSettings. Should be instantiated via the .from_file() method.

model_config = {'extra': 'forbid', 'frozen': True, 'use_attribute_docstrings': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

root_path: Path

Root folder path for the optimization run (default: parent folder of invoking script). Default value is only set when creating config via a file.

config_file_relpath: Path
paths: ConfigPaths

Optimization run paths.

setup: ConfigSetup

Optimization run setup.

settings: ConfigSettings

Optimization run settings.

property config_name: str

Name of the config file.

property results_path: Path

Path to the results folder (default: root_path/results).

property scenarios_path: Path

Path to the scenarios folder (default: root_path/scenarios).

model_post_init(_: Any) None[source]

Override this method to perform additional initialization after __init__ and model_construct. This is useful if you want to do some validation that requires the entire model to be initialized.

classmethod from_file(config_name: str, root_path: StrPath | None = None, config_relpath: StrPath | None = None, overwrite: Mapping[str, Any] | None = None) Config[source]