marmot.marmot_plot_main.MarmotPlot#

class MarmotPlot(Scenarios: typing.Union[str, list], AGG_BY: str, model_solutions_folder: typing.Union[str, pathlib.Path], gen_names_dict: typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame, dict], ordered_gen_categories: typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame], color_dictionary: typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame, dict], marmot_plot_select: typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame], marmot_solutions_folder: typing.Optional[typing.Union[str, pathlib.Path]] = None, scenario_diff: typing.Optional[typing.Union[str, list]] = None, zone_region_sublist: typing.Optional[typing.Union[str, list]] = None, xlabels: typing.Optional[typing.Union[str, list]] = None, ylabels: typing.Optional[typing.Union[str, list]] = None, ticklabels: typing.Optional[typing.Union[str, list]] = None, region_mapping: typing.Union[str, pathlib.Path, pandas.core.frame.DataFrame] = Empty DataFrame Columns: [] Index: [], tech_subset: typing.Optional[typing.Union[str, list]] = None, **kwargs)[source]#

Bases: marmot.utils.loggersetup.SetupLogger

Main module class to be instantiated to run the plotter.

MarmotPlot handles the selection of plotting module to create the desired figure and saving of outputs. It also handles the area aggregation selection

Parameters
  • Scenarios (Union[str, list]) – Name of scenarios to process.

  • AGG_BY (str) – Informs region type to aggregate by when creating plots.

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

  • gen_names_dict (Union[str, Path, pd.DataFrame, dict]) – Path to, Dataframe or dict of generator technologies to rename.

  • ordered_gen_categories (Union[str, Path, pd.DataFrame]) – Path to or Dataframe containing ordered generation and columns to specify technology subsets.

  • color_dictionary (Union[str, Path, pd.DataFrame, dict]) – Path to, Dataframe or dict containing list of colors to assign to each generator category.

  • marmot_plot_select (Union[str, Path, pd.DataFrame]) – Path to or DataFrame containing information on plots to create and certain settings.

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

  • scenario_diff (Union[str, list], optional) – 2 value string or list, used to compare 2 scenarios. Defaults to None.

  • zone_region_sublist (Union[str, list], optional) – Subset of regions to plot from AGG_BY. Defaults to None.

  • xlabels (Union[str, list], optional) – x axis labels for facet plots. Defaults to None.

  • ylabels (Union[str, list], optional) – y axis labels for facet plots. Defaults to None.

  • ticklabels (Union[str, list], optional) – custom ticklabels for plots, not available for every plot type. 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().

  • tech_subset (Union[str, list], optional) – Tech subset category to plot. The tech_subset value should be a column in the ordered_gen_categories.csv. If left None all techs will be plotted Defaults to None.

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

Methods

convert_str_to_list(string_object)

Converts a comma separated string to a list.

get_geographic_regions(meta)

Gets the geographic regions to plot based on the geographic aggregation.

run_plotter()

Main method to call to begin plotting figures.

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

color_dictionary

Dictionary of gen technology names to plotting colors.

gen_names_dict

Dictionary of existing gen technology names to new names.

marmot_plot_select

DataFrame containing information on plots to create and certain settings.

ordered_gen_categories

DataFrame containing generator order and category information

ordered_gen_list

List of ordered generator technolgies.

region_mapping

Region mapping Dataframe to map custom aggregations.

property ordered_gen_list: List[str]#

List of ordered generator technolgies.

Oder is specified in the ordered_gen_categories input.

Returns

Ordered list of generator technolgies

Return type

List[str]

property gen_names_dict: dict#

Dictionary of existing gen technology names to new names.

Used to rename technologies.

Returns

Keys: Existing names, Values: New names

Return type

dict

property ordered_gen_categories: pandas.core.frame.DataFrame#

DataFrame containing generator order and category information

Has at least one column named Ordered_Gen. Other columns define different generator technology category groupings.

Returns

ordered_gen_categories DataFrame

Return type

pd.DataFrame

property color_dictionary: dict#

Dictionary of gen technology names to plotting colors.

Returns

Keys gen technologies, Values colors

Return type

dict

property marmot_plot_select: pandas.core.frame.DataFrame#

DataFrame containing information on plots to create and certain settings.

Return type

pd.DataFrame

property region_mapping: pandas.core.frame.DataFrame#

Region mapping Dataframe to map custom aggregations.

Return type

pd.DataFrame

static convert_str_to_list(string_object: str) List[str][source]#

Converts a comma separated string to a list.

Parameters

string_object (str) – A comma separated string

Returns

list of strings.

Return type

List[str]

get_geographic_regions(meta: marmot.metamanagers.read_metadata.MetaData) List[str][source]#

Gets the geographic regions to plot based on the geographic aggregation.

The aggregation is determined with the AGG_BY attribute.

region and zone (PLEXOS) will pull model defined aggregations. Other aggregations will use values from the region mapping file.

The zone_region_sublist attribute can be used to reduce the set of geographic regions to plot.

Parameters

meta (MetaData) – instance of MetaData class

Returns

List of geographic regions to plot

Return type

List[str]

run_plotter()[source]#

Main method to call to begin plotting figures.

This method takes no input variables, all required variables are passed in via the __init__ method.