Data Sources

DataSource Base Class

A DataSource object must be given to const controllers in order to run time series simulations. The data source contains the values to be set in each time step by the controller. It has the function get_time_step_value(time_step) which reads these values.

class pandapower.timeseries.data_source.DataSource(**kwargs)

The DataSource class is a skeleton for data sources such as pandas DataFrames Controllers call get_time_step_values(time) in each time step to get values from the data source

get_time_step_value(time_step, profile_name, scale_factor=1.0)

This method retrieves values of the data source according to the given parameters. For actual parameters look into the DataSource you are actually using.

DataFrame Data Source

A DFData object is inherited from DataSource and contains a DataFrame which stores the time series values.

class pandapower.timeseries.data_sources.frame_data.DFData(df, multi=False)

Hold a pandas.DataFrame as the data source, that uses index column as time step. Take care that the data is numeric and all the time steps are present.

Please note: The columns should be integers for scalar accessing!

INPUT:

df - A pandas DataFrame which holds the time series data

OPTIONAL:

multi (bool, False) - If True casts columns and indexes to integers. This might be necessary if you read your data from csv.

get_time_step_value(time_step, profile_name, scale_factor=1.0)

This method retrieves values of the data source according to the given parameters. For actual parameters look into the DataSource you are actually using.