eta_ctrl.timeseries.scenarios module

eta_ctrl.timeseries.scenarios.import_scenario_config(scenario_config: ConfigCsvScenario, prefix_renamed: bool, slice_begin: datetime, slice_end: datetime, resample_time: TimeStep) pd.DataFrame[source]

Load a DataFrame from a ConfigCsvScenario object.

Parameters:
  • scenario_config (ConfigCsvScenario) – Config for csv file.

  • prefix_renamed (bool) – Whether newly prefixed values should get renamed too

  • start_time – Starting time for the scenario import

  • end_time – Latest ending time for the scenario import

  • resample_time (TimeStep) – Resample the scenario data to the specified interval. If given as an int, this will be interpreted as seconds

Raises:

ValueError – When none of the csv columns span from slice_begin to slice_end

Returns:

DataFrame with desired datetime index.

Return type:

pd.DataFrame

eta_ctrl.timeseries.scenarios.scenario_from_csv(scenario_configs: list[ConfigCsvScenario], *, start_time: datetime, end_time: datetime, resample_time: TimeStep, 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.

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

  • end_time – Latest ending time for the scenario import.

  • resample_time – Resample the scenario data to the specified interval. If given as an int, this will be interpreted as seconds.

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