marmot.plottingmodules.transmission.Transmission#

class Transmission(Zones: typing.List[str], Scenarios: typing.List[str], AGG_BY: str, ordered_gen: typing.List[str], marmot_solutions_folder: pathlib.Path, gen_categories: marmot.plottingmodules.plotutils.plot_data_helper.GenCategories = GenCategories(vre=[], pv=[], re=[], thermal=[]), scenario_diff: typing.Optional[typing.List[str]] = None, ylabels: typing.Optional[typing.List[str]] = None, xlabels: typing.Optional[typing.List[str]] = None, custom_xticklabels: typing.Optional[typing.List[str]] = None, color_list: list = ['#396AB1', '#CC2529', '#3E9651', '#ff7f00', '#6B4C9A', '#922428', '#cab2d6', '#6a3d9a', '#fb9a99', '#b15928'], region_mapping: pandas.core.frame.DataFrame = Empty DataFrame Columns: [] Index: [], **kwargs)[source]#

Bases: marmot.plottingmodules.plotutils.plot_data_helper.PlotDataStoreAndProcessor

System transmission plots.

The transmission.py module contains methods that are related to the transmission network.

Transmission inherits from the PlotDataStoreAndProcessor class to assist in creating figures.

Parameters
  • Zones (List[str]) – List of regions/zones to plot.

  • Scenarios (List[str]) – List of scenarios to plot.

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

  • ordered_gen (List[str]) – Ordered list of generator technologies to plot, order defines the generator technology position in stacked bar and area plots.

  • marmot_solutions_folder (Path) – Directory containing Marmot solution outputs.

  • gen_categories (GenCategories) – Instance of GenCategories class, groups generator technologies into defined categories. Deafults to GenCategories.

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

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

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

  • custom_xticklabels (List[str], optional) – List of custom x labels to apply to barplots. Values will overwite existing ones. Defaults to None.

  • color_list (list, optional) – List of colors to apply to non-gen plots. Defaults to ColorList().colors.

  • region_mapping (pd.DataFrame, optional) – Mapping file to map custom regions/zones to create custom aggregations. Aggregations are created by grouping PLEXOS regions. Defaults to pd.DataFrame().

Methods

extract_tx_cap([figure_name, prop, start, ...])

get_line_interface_limits(extra_property_names)

Get and process line and interface limits

int_flow_ind_diff([figure_name])

Plot under development

int_flow_ind_seasonal([figure_name, prop, ...])

#TODO: Finish Docstring

interface_flow_ind([figure_name, prop])

Timeseries or duration curve of individual interfaces.

line_flow_ind([figure_name, prop])

Timeseries or duration curve of individual lines.

line_flow_ind_diff([figure_name, prop])

#TODO: Finish Docstring

line_flow_ind_seasonal([figure_name, prop, ...])

TODO: Finish Docstring.

line_hist(**kwargs)

Creates a histogram of transmission lineflow utilization for each region.

line_scatter([figure_name, prop, start, ...])

line_util(**kwargs)

Creates a timeseries line plot of transmission lineflow utilization for each region.

line_violations_timeseries(**kwargs)

Creates a timeseries line plot of lineflow violations for each region.

line_violations_totals(**kwargs)

Creates a barplot of total lineflow violations for each region.

net_export([timezone, start_date_range, ...])

creates a timeseries net export line graph.

plot_line_interface_limits(limits, mplt, n)

Plots line/interface limits on a subplot

region_region_checkerboard(**_)

Creates a checkerboard/heatmap figure showing total interchanges between regions/zones.

region_region_interchange_all_regions(**kwargs)

#TODO: Finish Docstring

region_region_interchange_all_scenarios(**kwargs)

#TODO: Finish Docstring

total_int_flow_ind(prop[, start_date_range, ...])

Creates a clustered barplot of the total flow for a specific interface, separated by positive and negative flows.

zonal_interchange([figure_name, ...])

Creates a line plot of the net interchange between each zone, with a facet for each zone.

zonal_interchange_total([start_date_range, ...])

Creates a barplot of the net interchange between each zone, separated by positive and negative flows.

line_util(**kwargs)[source]#

Creates a timeseries line plot of transmission lineflow utilization for each region.

Utilization is plotted between 0 and 1 on the y-axis. The plot will default to showing the 10 highest utilized lines. A Line category can also be passed instead, using the property field in the Marmot_plot_select.csv Each scenarios is plotted on a separate Facet plot.

This methods calls _util() to create the figure.

Returns

Dictionary containing the created plot and its data table.

Return type

dict

line_hist(**kwargs)[source]#

Creates a histogram of transmission lineflow utilization for each region.

Utilization is plotted between 0 and 1 on the x-axis, with # lines on the y-axis. Each bar is equal to a 0.05 utilization rate The plot will default to showing all lines. A Line category can also be passed instead using the property field in the Marmot_plot_select.csv Each scenarios is plotted on a separate Facet plot.

This methods calls _util() and passes the hist=True argument to create the figure.

Returns

Dictionary containing the created plot and its data table.

Return type

dict

int_flow_ind_seasonal(figure_name: Optional[str] = None, prop: Optional[str] = None, start_date_range: Optional[str] = None, end_date_range: Optional[str] = None, **_)[source]#

#TODO: Finish Docstring

Parameters
  • figure_name (str, optional) – User defined figure output name. Defaults to None.

  • prop (str, optional) – Comma separated string of interchanges. Defaults to None.

  • start_date_range (str, optional) – Defines a start date at which to represent data from. Defaults to None.

  • end_date_range (str, optional) – Defines a end date at which to represent data to. Defaults to None.

Returns

dictionary containing the created plot and its data table

Return type

dict

int_flow_ind_diff(figure_name: Optional[str] = None, **_)[source]#

Plot under development

This method plots the hourly difference in interface flow between two scenarios for individual interfaces, with a facet for each interface. The two scenarios are defined in the “scenario_diff” row of Marmot_user_defined_inputs. The interfaces are specified in the plot properties field of Marmot_plot_select.csv (column 4). The figure and data tables are saved within the module.

Returns

Exception class, plot is not functional.

Return type

UnderDevelopment()

interface_flow_ind(figure_name: str = 'Individual_Interface_Flow', prop: Optional[str] = None, **kwargs)[source]#

Timeseries or duration curve of individual interfaces.

This method plots flow, import and export limit, for individual transmission interfaces, with a facet for each interface. The interfaces are specified in the plot properties field of Marmot_plot_select.csv (column 4). Figures and data tables are saved within the method.

Parameters
  • figure_name (str, optional) – Figure output name. Defaults to “Individual_Interface_Flow”.

  • prop (str, optional) – Used to pass in interface names. Input format should be a comma seperated string. Defaults to None.

  • **kwargs – Any additional parameters will be passed to the _tx_flow_ind method.

Returns

DataSavedInModule class

Return type

DataSavedInModule

line_flow_ind(figure_name: str = 'Individual_Line_Flow', prop: Optional[str] = None, **kwargs)[source]#

Timeseries or duration curve of individual lines.

This method plots flow, import and export limit, for individual transmission lines, with a facet for each line. The lines are specified in the plot properties field of Marmot_plot_select.csv (column 4). Figures and data tables are saved within the method.

Parameters
  • figure_name (str, optional) – Figure output name. Defaults to “Individual_Line_Flow”.

  • prop (str, optional) – Used to pass in line nams. Input format should be a comma seperated string. Defaults to None.

  • **kwargs – Any additional parameters will be passed to the _tx_flow_ind method.

Returns

DataSavedInModule class

Return type

DataSavedInModule

line_flow_ind_diff(figure_name: Optional[str] = None, prop: Optional[str] = None, **_)[source]#

#TODO: Finish Docstring

This method plots the flow difference for individual transmission lines, with a facet for each line. The scenarios are specified in the “Scenario_Diff_plot” field of Marmot_user_defined_inputs.csv. The lines are specified in the plot properties field of Marmot_plot_select.csv (column 4). Figures and data tables are saved in the module.

Parameters
  • figure_name (str, optional) – [description]. Defaults to None.

  • prop (str, optional) – [description]. Defaults to None.

Returns

[description]

Return type

[type]

line_flow_ind_seasonal(figure_name: Optional[str] = None, prop: Optional[str] = None, start_date_range: Optional[str] = None, end_date_range: Optional[str] = None, **_)[source]#

TODO: Finish Docstring.

This method differs from the previous method, in that it plots seasonal line limits. To use this method, line import/export must be an “interval” property, not a “year” property. This can be selected in “plexos_properties.csv”. Re-run the formatter if necessary, it will overwrite the existing properties in “*_formatted.h5”

This method plots flow, import and export limit, for individual transmission lines, with a facet for each line. The lines are specified in the plot properties field of Marmot_plot_select.csv (column 4). The plot includes every interchange that originates or ends in the aggregation zone. Figures and data tables saved in the module.

Parameters
  • figure_name (str, optional) – [description]. Defaults to None.

  • prop (str, optional) – [description]. Defaults to None.

  • start_date_range (str, optional) – [description]. Defaults to None.

  • end_date_range (str, optional) – [description]. Defaults to None.

Returns

DataSavedInModule class

Return type

DataSavedInModule

region_region_interchange_all_scenarios(**kwargs)[source]#

#TODO: Finish Docstring

This method creates a timeseries line plot of interchange flows between the selected region to each connecting region. If there are more than 4 total interchanges, all other interchanges are aggregated into an ‘other’ grouping Each scenarios is plotted on a separate Facet plot. Figures and data tables are returned to plot_main

region_region_interchange_all_regions(**kwargs)[source]#

#TODO: Finish Docstring

This method creates a timeseries line plot of interchange flows between the selected region to each connecting region. All regions are plotted on a single figure with each focus region placed on a separate facet plot If there are more than 4 total interchanges, all other interchanges are aggregated into an ‘other’ grouping This figure only plots a single scenario that is defined by Main_scenario_plot in user_defined_inputs.csv. Figures and data tables are saved within method

region_region_checkerboard(**_)[source]#

Creates a checkerboard/heatmap figure showing total interchanges between regions/zones.

Each scenario is plotted on its own facet plot. Plots and Data are saved within the module.

Returns

DataSavedInModule exception.

Return type

DataSavedInModule

line_violations_timeseries(**kwargs)[source]#

Creates a timeseries line plot of lineflow violations for each region.

The magnitude of each violation is plotted on the y-axis Each sceanrio is plotted as a separate line.

This methods calls _violations() to create the figure.

Returns

Dictionary containing the created plot and its data table.

Return type

dict

line_violations_totals(**kwargs)[source]#

Creates a barplot of total lineflow violations for each region.

Each sceanrio is plotted as a separate bar.

This methods calls _violations() and passes the total_violations=True argument to create the figure.

Returns

Dictionary containing the created plot and its data table.

Return type

dict

net_export(timezone: str = '', start_date_range: Optional[str] = None, end_date_range: Optional[str] = None, **_)[source]#

creates a timeseries net export line graph.

Scenarios are plotted as separate lines.

Parameters
  • timezone (str, optional) – The timezone to display on the x-axes. Defaults to “”.

  • start_date_range (str, optional) – Defines a start date at which to represent data from. Defaults to None.

  • end_date_range (str, optional) – Defines a end date at which to represent data to. Defaults to None.

Returns

dictionary containing the created plot and its data table

Return type

dict

zonal_interchange(figure_name: str = 'zonal_interchange', start_date_range: Optional[str] = None, end_date_range: Optional[str] = None, **_)[source]#

Creates a line plot of the net interchange between each zone, with a facet for each zone.

The method will only work if agg_by = “zone”.

The code will create either a timeseries or duration curve depending on if the word ‘duration_curve’ is in the figure_name. To make a duration curve, ensure the word ‘duration_curve’ is found in the figure_name.

Parameters
  • figure_name (str, optional) – User defined figure output name. Defaults to None.

  • start_date_range (str, optional) – Defines a start date at which to represent data from. Defaults to None.

  • end_date_range (str, optional) – Defines a end date at which to represent data to. Defaults to None.

Returns

dictionary containing the created plot and its data table

Return type

dict

zonal_interchange_total(start_date_range: Optional[str] = None, end_date_range: Optional[str] = None, **_)[source]#

Creates a barplot of the net interchange between each zone, separated by positive and negative flows.

The method will only work if agg_by = “zone”.

Parameters
  • start_date_range (str, optional) – Defines a start date at which to represent data from. Defaults to None.

  • end_date_range (str, optional) – Defines a end date at which to represent data to. Defaults to None.

Returns

dictionary containing the created plot and its data table

Return type

dict

total_int_flow_ind(prop: str, start_date_range: Optional[str] = None, end_date_range: Optional[str] = None, **_)[source]#

Creates a clustered barplot of the total flow for a specific interface, separated by positive and negative flows.

Specify the interface(s) of interest by providing a comma separated string to the property entry. Scenarios are clustered together as different colored bars. If multiple interfaces are provided, each will be plotted as a separate group of clustered bar.

Parameters
  • prop (str) – Comma separated string of interfaces to plot.

  • start_date_range (str, optional) – Defines a start date at which to represent data from. Defaults to None.

  • end_date_range (str, optional) – Defines a end date at which to represent data to. Defaults to None.

Returns

DataSavedInModule exception.

Return type

DataSavedInModule

get_line_interface_limits(extra_property_names: list, object_name: Optional[str] = None) pandas.core.frame.DataFrame[source]#

Get and process line and interface limits

Gets limits for all scenarios. If limits are equal across all scenarios, only retunrs a single set of limts else returns limits for each scenario.

Parameters
  • extra_property_names (list) – list of limit property names.

  • object_name (str, optional) – Name of line or interface if only a single object is needed.

Returns

dataframe of limts

Return type

pd.DataFrame

plot_line_interface_limits(limits: pandas.core.frame.DataFrame, mplt: marmot.plottingmodules.plotutils.plot_library.PlotLibrary, n: int, duration_curve: bool = False) None[source]#

Plots line/interface limits on a subplot

Parameters
  • limits (pd.DataFrame) – dataframe of import/export limits with a timeseries

  • mplt (PlotLibrary) – Instance of PlotLibrary

  • n (int) – Counter for subplots

  • duration_curve (bool, optional) – When potting a duration curve. If True, uses the max of the limit values. Defaults to False.