microgrid.history package

Module contents

The history module gathers all functionalities related to the organization of time series data that are used by the simulator and by the forecasters.

class microgrid.history.Database(path_to_csv, grid)[source]
__init__(path_to_csv, grid)[source]

A Database objects holds the realized data of the microgrid in a pandas dataframe.

The CSV file values are separated by ‘;’ and the first line must contain series names. It must contain

  • a ‘DateTime’ column with values interpretable as python date time objects.
  • a ‘Price’ column with values interpretable as floats.
  • All the non-flexible quantities (load and generation) described in the microgrid configuration

Some new columns are generated from the DateTime column to indicate e.g. whether a datetime corresponds to a day of the week or not.

Parameters:
  • path_to_csv – Path to csv containing realized data
  • grid – A Grid object describing the configuration of the microgrid
get_column(column_indexer, dt_from, dt_to)[source]
Parameters:
  • column_indexer – The name of a column
  • dt_from – A start datetime
  • dt_to – An end datetime
Returns:

A list of values of the column_indexer series between dt_from and dt_to

get_columns(column_indexer, time_indexer)[source]
Parameters:
  • column_indexer – The name of a column
  • time_indexer – A datetime
Returns:

The realized value of the series column_indexer at time time_indexer

get_times(time_indexer)[source]
Parameters:time_indexer – A date time
Returns:A list containing the value of all the series at time time_indexer
read_data(path)[source]

Read data and generate new columns based on the DateTime column.

Parameters:path – Path to the csv data file
Returns:A pandas dataframe