marmot.formatters.formatreeds.ProcessReEDS#

class ProcessReEDS(input_folder: pathlib.Path, output_file_path: pathlib.Path, *args, process_subset_years: typing.Optional[list] = None, region_mapping: pandas.core.frame.DataFrame = Empty DataFrame Columns: [] Index: [], **kwargs)[source]#

Bases: marmot.formatters.formatbase.Process

Process ReEDS specific data from a ReEDS result set.

Parameters
  • input_folder (Path) – Folder containing csv files.

  • output_file_path (Path) – Path to formatted h5 output file.

  • process_subset_years (list, optional) – If provided only process years specified. Defaults to None.

  • region_mapping (pd.DataFrame, optional) – DataFrame to map custom regions/zones to create custom aggregations. Defaults to pd.DataFrame().

  • **kwargs – These parameters will be passed to the Process class.

Methods

df_process_generator(df[, prop, gdx_file])

Does any additional processing for generator properties

df_process_line(df[, prop, gdx_file])

Does any additional processing for line properties

df_process_reserves_generators(df[, prop, ...])

Does any additional processing for reserves_generators properties

get_processed_data(prop_class, prop, ...)

Handles the pulling of data from the ReEDS gdx file and then passes the data to one of the formating functions

merge_timeseries_block_data(df)

Merge chronological time intervals with reeds timeslices

output_metadata(files_list)

Add ReEDS specific metadata to formatted h5 file .

Attributes

GDX_RESULTS_PREFIX

Prefix of gdx results file

PROPERTY_MAPPING

Maps simulation model property names to Marmot property names

UNITS_CONVERSION

Dictionary to convert units to standard values used by Marmot

data_collection

Dictionary input file names to full filename path

get_input_data_paths

Gets a list of input gdx files within the scenario folders

input_folder

Path to input folder

property_units

Gets the property units from data, e.g MW, MWh

reeds_prop_cols

Get the ReEDSPropertyColumns dataclass

wind_resource_to_pca

Get the wind resource (s) to pca/region mapping

PROPERTY_MAPPING: dict = {'emission_emit_r': 'emission_Production', 'generator_cap_out': 'generator_Installed_Capacity', 'generator_curt_out': 'generator_Curtailment', 'generator_gen_out': 'generator_Generation', 'generator_gen_out_ann': 'generator_Generation_Annual', 'generator_stor_in': 'generator_Pump_Load', 'generator_systemcost_techba': 'generator_Total_Generation_Cost', 'line_losses_tran_h': 'line_Losses', 'line_tran_flow_power': 'line_Flow', 'line_tran_out': 'line_Import_Limit', 'region_load_rt': 'region_Demand', 'reserves_generators_opRes_supply': 'reserves_generators_Provision_Annual', 'reserves_generators_opRes_supply_h': 'reserves_generators_Provision', 'storage_stor_energy_cap': 'storage_Max_Volume'}#

Maps simulation model property names to Marmot property names

GDX_RESULTS_PREFIX = 'rep_'#

Prefix of gdx results file

EXTRA_PROPERTIES_CLASS#

alias of marmot.formatters.formatextra.ExtraReEDSProperties

property reeds_prop_cols: marmot.formatters.formatreeds.ReEDSPropertyColumns#

Get the ReEDSPropertyColumns dataclass

Returns

ReEDSPropertyColumns

property property_units: dict#

Gets the property units from data, e.g MW, MWh

Returns

property_units

Return type

dict

property wind_resource_to_pca: dict#

Get the wind resource (s) to pca/region mapping

Returns

wind_resource_to_pca mapping

Return type

dict

property get_input_data_paths: list#

Gets a list of input gdx files within the scenario folders

property data_collection: Dict[str, pathlib.Path]#

Dictionary input file names to full filename path

Returns

data_collection {filename: fullpath}

Return type

dict

output_metadata(files_list: list) None[source]#

Add ReEDS specific metadata to formatted h5 file .

Parameters

files_list (list) – List of all gdx files in inputs folder in alpha numeric order.

get_processed_data(prop_class: str, prop: str, timescale: str, model_name: str) pandas.core.frame.DataFrame[source]#

Handles the pulling of data from the ReEDS gdx file and then passes the data to one of the formating functions

Parameters
  • prop_class (str) – Property class e.g Region, Generator, Zone etc

  • prop (str) – Property e.g gen_out, cap_out etc.

  • timescale (str) – Data timescale, e.g interval, summary.

  • model_name (str) – name of model to process.

Returns

Formatted results dataframe.

Return type

pd.DataFrame

merge_timeseries_block_data(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]#

Merge chronological time intervals with reeds timeslices

Parameters

df (pd.DataFrame) – input dataframe

Returns

df with merged in timeseries data

Return type

pd.DataFrame

df_process_generator(df: pandas.core.frame.DataFrame, prop: Optional[str] = None, gdx_file: Optional[str] = None) pandas.core.frame.DataFrame[source]#

Does any additional processing for generator properties

Parameters
  • df (pd.DataFrame) – input dataframe

  • prop (str, optional) – ReEDS input property. Defaults to None.

  • gdx_file (str, optional) – String path to GDX file. Defaults to None.

Return type

pd.DataFrame

df_process_line(df: pandas.core.frame.DataFrame, prop: Optional[str] = None, gdx_file: Optional[str] = None) pandas.core.frame.DataFrame[source]#

Does any additional processing for line properties

Parameters
  • df (pd.DataFrame) – input dataframe

  • prop (str, optional) – ReEDS input property. Defaults to None.

  • gdx_file (str, optional) – String path to GDX file. Defaults to None.

Return type

pd.DataFrame

df_process_reserves_generators(df: pandas.core.frame.DataFrame, prop: Optional[str] = None, gdx_file: Optional[str] = None) pandas.core.frame.DataFrame[source]#

Does any additional processing for reserves_generators properties

Parameters
  • df (pd.DataFrame) – input dataframe

  • prop (str, optional) – ReEDS input property. Defaults to None.

  • gdx_file (str, optional) – String path to GDX file. Defaults to None.

Return type

pd.DataFrame