eta_ctrl.timeseries.scenarios module

eta_ctrl.timeseries.scenarios.scenario_from_csv(scenario_configs: list[ConfigCsvScenario], *, start_time: datetime, end_time: datetime | None = None, total_time: TimeStep | None = None, random: np.random.Generator | bool | None = False, resample_time: TimeStep | None = None, prefix_renamed: bool = True) pd.DataFrame[source]

Import (possibly multiple) scenario data files from csv files and return them as a single pandas data frame. The import function supports column renaming and will slice and resample data as specified.

Raises:

ValueError – If start and/or end times are outside the scope of the imported scenario files.

Note

The ValueError will only be raised when this is true for all files. If only one file is outside the range, an empty series will be returned for that file.

Parameters:
  • start_time – Starting time for the scenario import.

  • end_time – Latest ending time for the scenario import (default: inferred from start_time and total_time).

  • total_time – Total duration of the imported scenario. If given as int this will be interpreted as seconds (default: inferred from start_time and end_time).

  • random – Set to true if a random starting point (within the interval determined by start_time and end_time) should be chosen. This will use the environments’ random generator.

  • resample_time – Resample the scenario data to the specified interval. If given as an int, this will be interpreted as seconds. If resample_time is None, it will be treated as 0 (default: None).

  • prefix_renamed – Should prefixes be applied to renamed columns as well? When setting this to false make sure that all columns in all loaded scenario files have different names. Otherwise, there is a risk of overwriting data.

Returns:

Imported and processed data as pandas.DataFrame.