marmot.plottingmodules.reserves.Reserves#
- class Reserves(Zones: List[str], Scenarios: List[str], AGG_BY: str, ordered_gen: List[str], marmot_solutions_folder: pathlib.Path, marmot_color_dict: Optional[dict] = None, ylabels: Optional[List[str]] = None, xlabels: Optional[List[str]] = None, custom_xticklabels: Optional[List[str]] = None, color_list: list = ['#396AB1', '#CC2529', '#3E9651', '#ff7f00', '#6B4C9A', '#922428', '#cab2d6', '#6a3d9a', '#fb9a99', '#b15928'], **kwargs)[source]#
Bases:
marmot.plottingmodules.plotutils.plot_data_helper.PlotDataStoreAndProcessor
Generator and system reserve plots.
The reserves.py module contains methods that are related to reserve provision and shortage.
Reserves 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.
marmot_color_dict (dict, optional) – Dictionary of colors to use for generation technologies. 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.
Methods
reg_reserve_provision
(**kwargs)Creates a bar plot of reserve provision for each region in MWh.
reg_reserve_shortage
(**kwargs)Creates a bar plot of reserve shortage for each region in MWh.
reg_reserve_shortage_hrs
(**kwargs)creates a bar plot of reserve shortage for each region in hrs.
Creates a timeseries line plot of reserve shortage.
reserve_gen_timeseries
([prop, start, end, ...])Creates a generation timeseries stackplot of total cumulative reserve provision by tech type.
total_reserves_by_gen
([start_date_range, ...])Creates a generation stacked barplot of total reserve provision by generator tech type.
- reserve_gen_timeseries(prop: Optional[str] = None, start: Optional[float] = None, end: Optional[float] = None, timezone: str = '', start_date_range: Optional[str] = None, end_date_range: Optional[str] = None, data_resolution: str = '', **_)[source]#
Creates a generation timeseries stackplot of total cumulative reserve provision by tech type.
The code will create either a facet plot or a single plot depending on if the Facet argument is active. If a facet plot is created, each scenario is plotted on a separate facet, otherwise all scenarios are plotted on a single plot. To make a facet plot, ensure the work ‘Facet’ is found in the figure_name. Generation order is determined by the ordered_gen_categories.csv.
- Parameters
prop (str, optional) –
Special argument used to adjust specific plot settings. Controlled through the plot_select.csv. Opinions available are:
Peak Demand
Defaults to None.
start (float, optional) – Used in conjunction with the prop argument. Will define the number of days to plot before a certain event in a timeseries plot, e.g Peak Demand. Defaults to None.
end (float, optional) – Used in conjunction with the prop argument. Will define the number of days to plot after a certain event in a timeseries plot, e.g Peak Demand. Defaults to None.
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.
data_resolution (str, optional) –
Specifies the data resolution to pull from the formatted data and plot. Defaults to “”, which will pull interval data.
New in version 0.10.0.
- Returns
Dictionary containing the created plot and its data table.
- Return type
- total_reserves_by_gen(start_date_range: Optional[str] = None, end_date_range: Optional[str] = None, scenario_groupby: str = 'Scenario', **_)[source]#
Creates a generation stacked barplot of total reserve provision by generator tech type.
A separate bar is created for each scenario.
- 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.
scenario_groupby (str, optional) –
Specifies whether to group data by Scenario or Year-Sceanrio. If grouping by Year-Sceanrio the year will be identified from the timestamp and appeneded to the sceanrio name. This is useful when plotting data which covers multiple years such as ReEDS. Defaults to Scenario.
New in version 0.10.0.
- Returns
Dictionary containing the created plot and its data table.
- Return type
- reg_reserve_shortage(**kwargs)[source]#
Creates a bar plot of reserve shortage for each region in MWh.
Bars are grouped by reserve type, each scenario is plotted as a differnet color.
The ‘Shortage’ argument is passed to the _reserve_bar_plots() method to create this plot.
- Returns
Dictionary containing the created plot and its data table.
- Return type
- reg_reserve_provision(**kwargs)[source]#
Creates a bar plot of reserve provision for each region in MWh.
Bars are grouped by reserve type, each scenario is plotted as a differnet color.
The ‘Provision’ argument is passed to the _reserve_bar_plots() method to create this plot.
- Returns
Dictionary containing the created plot and its data table.
- Return type
- reg_reserve_shortage_hrs(**kwargs)[source]#
creates a bar plot of reserve shortage for each region in hrs.
Bars are grouped by reserve type, each scenario is plotted as a differnet color.
The ‘Shortage’ argument and count_hours=True is passed to the _reserve_bar_plots() method to create this plot.
- Returns
Dictionary containing the created plot and its data table.
- Return type
- reg_reserve_shortage_timeseries(figure_name: Optional[str] = None, timezone: str = '', start_date_range: Optional[str] = None, end_date_range: Optional[str] = None, data_resolution: str = '', **_)[source]#
Creates a timeseries line plot of reserve shortage.
A line is plotted for each reserve type shortage.
The code will create either a facet plot or a single plot depending on if the Facet argument is active. If a facet plot is created, each scenario is plotted on a separate facet, otherwise all scenarios are plotted on a single plot. To make a facet plot, ensure the work ‘Facet’ is found in the figure_name.
- Parameters
figure_name (str, optional) – User defined figure output name. Used here to determine if a Facet plot should be created. Defaults to None.
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.
data_resolution (str, optional) –
Specifies the data resolution to pull from the formatted data and plot. Defaults to “”, which will pull interval data.
New in version 0.10.0.
- Returns
Dictionary containing the created plot and its data table.
- Return type