eta_ctrl.config.config module
- class eta_ctrl.config.config.Config(*, config_name: str, root_path, state_relpath, results_relpath: str | Path | None = PosixPath('results'), scenarios_relpath: str | Path | None = PosixPath('scenarios'), setup: ConfigSetup, settings: ConfigSettings)[source]
Bases:
objectConfiguration for the optimization, which can be loaded from a JSON file.
- root_path: Path
Root folder path for the optimization run (default: parent folder of invoking script).
- state_relpath: Path
Relative path to the state config file (default: environments/[environment_classname]_state_config).
- setup: ConfigSetup
Optimization run setup.
- settings: ConfigSettings
Optimization run settings.
- classmethod from_file(root_path: Path | None, config_relpath: Path | None, config_name: str, overwrite: Mapping[str, Any] | None = None) Config[source]
Load configuration from JSON/TOML/YAML file, which consists of the following sections:
paths: In this section, the (relative) file paths for results and scenarios are specified. The paths are deserialized directly into the
Configobject.setup: This section specifies which classes and utilities should be used for optimization. The setup configuration is deserialized into the
ConfigSetupobject.settings: The settings section contains basic parameters for the optimization, it is deserialized into a
ConfigSettingsobject.environment_specific: The environment section contains keyword arguments for the environment. This section must contain values for the arguments of the environment, the expected values are therefore different depending on the environment and not fully documented here.
agent_specific: The agent section contains keyword arguments for the control algorithm (agent). This section must contain values for the arguments of the agent, the expected values are therefore different depending on the agent and not fully documented here.
- Parameters:
root_path – Path to the experiment root.
config_relpath – Path to the configuration directory, relative to root_path.
config_name – Name of the configuration file, without extension.
overwrite – Config parameters to overwrite.
- Returns:
Config object.