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: object

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

config_name: str

Name of the configuration used for the series of run.

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).

results_relpath: Path

Relative path to the results folder (default: results).

scenarios_relpath: Path

relative path to the scenarios folder (default: scenarios).

results_path: Path

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

scenarios_path: Path

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

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 Config object.

  • setup: This section specifies which classes and utilities should be used for optimization. The setup configuration is deserialized into the ConfigSetup object.

  • settings: The settings section contains basic parameters for the optimization, it is deserialized into a ConfigSettings object.

  • 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.