marmot.marmot_h5_formatter.MarmotFormat#

class MarmotFormat(Scenario_name: str, model_solutions_folder: typing.Union[str, pathlib.Path], properties_file: typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame], marmot_solutions_folder: typing.Optional[typing.Union[str, pathlib.Path]] = None, region_mapping: typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame] = Empty DataFrame Columns: [] Index: [], emit_names_dict: typing.Optional[typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame, dict]] = None, **kwargs)[source]#

Bases: marmot.utils.loggersetup.SetupLogger

Main module class to be instantiated to run the formatter.

MarmotFormat handles the passing on information to the various Process classes and handles the saving of formatted results. Once the outputs have been processed, they are saved to an intermediary hdf5 file which can then be read into the Marmot plotting code

Parameters
  • Scenario_name (str) – Name of scenario to process.

  • model_solutions_folder (Union[str, Path]) – Directory containing model simulation results subfolders and their files.

  • properties_file (Union[str, Path, pd.DataFrame]) – Path to or DataFrame of properties to process.

  • marmot_solutions_folder (Union[str, Path], optional) – Direcrory to save Marmot solution files. Defaults to None.

  • region_mapping (Union[str, Path, pd.DataFrame], optional) – Path to or Dataframe to map custom regions/zones to create custom aggregations. Aggregations are created by grouping PLEXOS regions. Defaults to pd.DataFrame().

  • emit_names_dict (Union[str, Path, pd.DataFrame, dict], optional) – Path to, DataFrame or dict to rename emissions types. Defaults to None.

  • **kwargs – These parameters will be passed to the marmot.utils.loggersetup.SetupLogger class.

Methods

run_formatter([sim_model, plexos_block, ...])

Main method to call to begin formatting simulation model results

Attributes

DEFAULT_LOG_CONFIG

Default log config if LOG_CONFIG_FILE cannot be found

LOG_CONFIG_FILE

Name of default logging config file located in utils package

emit_names_dict

Dictionary of existing emissions names to new names.

properties_file

DataFrame containing information on model properties to process.

region_mapping

Region mapping Dataframe to map custom aggregations.

property properties_file: pandas.core.frame.DataFrame#

DataFrame containing information on model properties to process.

Return type

pd.DataFrame

property region_mapping: pandas.core.frame.DataFrame#

Region mapping Dataframe to map custom aggregations.

Return type

pd.DataFrame

property emit_names_dict: dict#

Dictionary of existing emissions names to new names.

Returns

Keys Existing names, Values: New names

Return type

dict

run_formatter(sim_model: str = 'PLEXOS', plexos_block: str = 'ST', append_block_name: bool = False, process_subset_years: Optional[list] = None) None[source]#

Main method to call to begin formatting simulation model results

Parameters
  • sim_model (str, optional) – Name of simulation model to process data for. Defaults to ‘PLEXOS’.

  • plexos_block (str, optional) – PLEXOS results type. Defaults to ‘ST’.

  • append_block_name (bool, optional) – Append block type to scenario name. Defaults to False.

  • process_subset_years (list, optional) – If provided only process years specified. (Only used for sim_model = ReEDS) Defaults to None.