marmot.formatters.formatplexos.ProcessPLEXOS#
- class ProcessPLEXOS(input_folder: pathlib.Path, output_file_path: pathlib.Path, *args, plexos_block: str = 'ST', region_mapping: pandas.core.frame.DataFrame = Empty DataFrame Columns: [] Index: [], **kwargs)[source]#
Bases:
marmot.formatters.formatbase.Process
Process PLEXOS class specific data from a h5plexos database.
- Parameters
input_folder (Path) – Folder containing h5plexos h5 files.
output_file_path (Path) – Path to formatted h5 output file.
plexos_block (str, optional) – PLEXOS results type. Defaults to ‘ST’.
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_abatement
(df, model_name)Format PLEXOS Abatement Class data.
df_process_batterie
(df, model_name)Method for formatting data which comes form the PLEXOS Batteries Class
df_process_constraint
(df, model_name)Format PLEXOS Constraint Class data.
df_process_emission
(df, model_name)Format PLEXOS Emission Class data.
df_process_emissions_generators
(df, model_name)Format PLEXOS Emissions_Generators Relational Class data.
df_process_fuel
(df, model_name)Format PLEXOS Fuel Class data.
df_process_generator
(df, model_name)Format PLEXOS Generator Class data.
df_process_interface
(df, model_name)Format PLEXOS PLEXOS Interface Class data.
df_process_line
(df, model_name)Format PLEXOS Line Class data.
df_process_node
(df, model_name)Format PLEXOS Node Class data.
df_process_region
(df, model_name)Format PLEXOS Region Class data.
df_process_region_regions
(df, model_name)Format PLEXOS Region_Regions Relational Class data.
df_process_reserve
(df, model_name)Format PLEXOS Reserve Class data.
df_process_reserves_generators
(df, model_name)Format PLEXOS Reserve_Generators Relational Class data.
df_process_storage
(df, model_name)Format PLEXOS Storage Class data.
df_process_waterway
(df, model_name)Format PLEXOS Waterway Class data.
df_process_zone
(df, model_name)Format PLEXOS Zone Class data.
get_processed_data
(prop_class, prop, ...)Handles the pulling of data from the h5plexos hdf5 file and then passes the data to one of the formating functions
merge_timeseries_block_data
(db, df)Merge chronological time intervals and block data found in LT, MT and PASA results
output_metadata
(files_list)Transfers metadata from original PLEXOS solutions file to processed HDF5 file.
Attributes
Maps simulation model property names to Marmot property names
UNITS_CONVERSION
Dictionary to convert units to standard values used by Marmot
Dictionary model file names to h5 PLEXOSSolution
Gets a list of h5plexos input files within the scenario folders
input_folder
Path to input folder
- PROPERTY_MAPPING: dict = {'generator_Reserves_VO&M_Cost': 'generator_Reserves_VOM_Cost', 'generator_Start_&_Shutdown_Cost': 'generator_Start_and_Shutdown_Cost', 'generator_VO&M_Cost': 'generator_VOM_Cost'}#
Maps simulation model property names to Marmot property names
- EXTRA_PROPERTIES_CLASS#
alias of
marmot.formatters.formatextra.ExtraPLEXOSProperties
- property get_input_data_paths: list#
Gets a list of h5plexos input files within the scenario folders
- Returns
list of h5plexos input filenames to process
- Return type
- property data_collection: Dict[str, h5plexos.query.solution.PLEXOSSolution]#
Dictionary model file names to h5 PLEXOSSolution
- Returns
data_collection {filename: PLEXOSSolution}
- Return type
- output_metadata(files_list: list) None [source]#
Transfers metadata from original PLEXOS solutions file to processed HDF5 file.
For each partition in a given scenario, the metadata from that partition is copied over and saved in the processed output file.
- Parameters
files_list (list) – List of all h5 files in hdf5 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 h5plexos hdf5 file and then passes the data to one of the formating functions
- Parameters
- Returns
Formatted results dataframe.
- Return type
pd.DataFrame
- merge_timeseries_block_data(db: h5plexos.query.solution.PLEXOSSolution, df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame [source]#
Merge chronological time intervals and block data found in LT, MT and PASA results
- Parameters
db (PLEXOSSolution) – PLEXOSSolution instance for specific h5plexos file.
df (pd.DataFrame) – h5plexos dataframe
- Returns
df with merged in timeseries data
- Return type
pd.DataFrame
- df_process_generator(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Generator Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_region(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Region Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_zone(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Zone Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_line(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Line Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_interface(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS PLEXOS Interface Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_reserve(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Reserve Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_reserves_generators(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Reserve_Generators Relational Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_fuel(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Fuel Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_constraint(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Constraint Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_emission(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Emission Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_emissions_generators(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Emissions_Generators Relational Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_storage(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Storage Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_region_regions(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Region_Regions Relational Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_node(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Node Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_abatement(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Abatement Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_batterie(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Method for formatting data which comes form the PLEXOS Batteries Class
- Returns
df – Processed Output, single value column with multiindex.
- Return type
pd.DataFrame
- df_process_waterway(df: pandas.core.frame.DataFrame, model_name: str) pandas.core.frame.DataFrame [source]#
Format PLEXOS Waterway Class data.
- Parameters
df (pd.DataFrame) – h5plexos dataframe to process
model_name (str) – name of h5plexos h5 file being processed
- Returns
Processed output, single value column with multiindex.
- Return type
pd.DataFrame