eta_ctrl.config.config_settings module

eta_ctrl.config.config_settings.convert_datetime(datetime_: str | datetime | None) datetime | None[source]

Convert a string to a datetime object using pandas.

class eta_ctrl.config.config_settings.ConfigSettings(*, seed: int | None = None, verbose: ~typing.Annotated[int, ~annotated_types.Ge(ge=0), ~annotated_types.Le(le=3)] = 2, n_environments: ~typing.Annotated[int, ~annotated_types.Ge(ge=1)] = 1, n_episodes_play: ~types.Annotated[int | None, ~annotated_types.Ge(ge=1)] = 1, n_episodes_learn: ~types.Annotated[int | None, ~annotated_types.Ge(ge=1)] = 1, save_model_every_x_episodes: ~typing.Annotated[int, ~annotated_types.Ge(ge=1)] = 10, plot_interval: ~typing.Annotated[int, ~annotated_types.Ge(ge=1)] = 10, scenario_time_begin: ~datetime.datetime | None = None, scenario_time_end: ~datetime.datetime | None = None, use_random_time_slice: bool = False, sampling_time: ~typing.Annotated[float, ~annotated_types.Gt(gt=0)], episode_duration: ~typing.Annotated[float, ~annotated_types.Gt(gt=0)], prediction_horizon: ~types.Annotated[float | None, ~annotated_types.Gt(gt=0)] = None, sim_steps_per_sample: ~types.Annotated[int | None, ~annotated_types.Ge(ge=1)] = None, scale_actions: float | None = None, round_actions: ~types.Annotated[int | None, ~annotated_types.Ge(ge=1)] = None, environment: dict[str, ~typing.Any] = <factory>, agent: dict[str, ~typing.Any] = <factory>, log_to_file: bool = True, scenario_files: list[~eta_ctrl.timeseries.scenario_manager.ConfigCsvScenario] | None = None, **extra_data: ~typing.Any)[source]

Bases: BaseModel

Helper class, which is part of Config, for settings parameters.

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

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

seed: int | None

Seed for random sampling (default: None).

verbose: int

Logging verbosity of the framework (default: 2).

n_environments: int

Number of vectorized environments to instantiate (if not using DummyVecEnv) (default: 1).

n_episodes_play: int | None

Number of episodes to execute when the agent is playing (default: None).

n_episodes_learn: int | None

Number of episodes to execute when the agent is learning (default: None).

save_model_every_x_episodes: int

How often to save the model during training (default: 10 - after every ten episodes).

plot_interval: int

How many episodes to pass between each render call (default: 10 - after every ten episodes).

scenario_time_begin: datetime | None

Beginning time of the scenario.

scenario_time_end: datetime | None

Ending time of the scenario.

use_random_time_slice: bool

Boolean flag whether to use a random time slice when the difference of scenario_time_end and scenario_time_begin is greater than the episode duration (default: False).

sampling_time: float

Duration between time samples in seconds (can be a float value).

episode_duration: float

Duration of an episode in seconds (can be a float value).

prediction_horizon: float | None

Total duration of one prediction/optimization run when used with the MPC agent.

sim_steps_per_sample: int | None

Simulation steps for every sample.

scale_actions: float | None

Multiplier for scaling the agent actions before passing them to the environment (default: None).

round_actions: int | None

Number of digits to round actions to before passing them to the environment (default: None).

environment: dict[str, Any]

Settings dictionary for specifically the environment.

agent: dict[str, Any]

Settings dictionary for specifically the agent.

log_to_file: bool

Flag which is true if the log output should be written to a file (default: True).

scenario_files: list[ConfigCsvScenario] | None
property n_prediction_steps: int | None

Amount of steps in the prediction_horizon.

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.

create_scenario_manager(scenarios_path: Path) None[source]

Create a ScenarioManager for the environment.

Parameters:

scenarios_path (Path) – Path to the scenario files, default None.