Multi-Scenario Objects#

The purpose of the MultiScenario object is to facilitate data management across a multitude of scenarios while maintaining the familiar BaseScenario api. The primary difference being that an additional index level is added to each output frame.

Use Cases#

This object is particularly useful in the following situations:

  • Comparing a translation from a Capacity Expansion Model to a Production Cost Model using a tool like R2X

  • Comparing multiple simulation runs of the same Production Cost Model with slight changes like N-m contingency analysis, or techno-economic tradeoff analysis.

Recommendations#

It is recommended that individual Scenario Objects share a common TechnologyMapping and Area set. This way the data returned is well aligned for comparisons. For multi-year scenarios of the same/similar model, it is recommended to use a single scenario object and aggregate across multiple years by passing multiple simulation files representing those years.

Initializing a MultiScenario Object#

from gat.scenariohandlers import MultiScenario

# the keys will override the display_name of each scenario.
ms = MultiScenario({"reeds":reeds_scenario, "sienna":sienna_scenario})

ms.get_generation_capacity() # returns capacity by area

Option 2#

from gat.scenariohandler import MultiScenario

ms = MultiScenario()
ms.add_scenario("reeds", rscen2)

API#

Provides a multi-scenario handler for comparing multiple scenarios.

This module defines the MultiScenario class, which provides methods for accessing and processing data from multiple scenario objects at once, presenting the combined data in a single DataFrame with an additional ‘Scenario’ index level.

class gat.scenariohandlers.multi.MultiScenario(scenarios={})#

Class for handling multiple scenarios with a familiar API.

This class aggregates data from multiple BaseScenario objects, allowing for comparative analysis across different scenarios. Methods in this class mirror those in BaseScenario but return DataFrames that include a ‘Scenario’ level in the column index to distinguish data from different scenarios.

Parameters:

scenarios (Dict[str, BaseScenario]) – A dictionary mapping a display name (str) to a scenario object (BaseScenario).

add_scenario(scenario_obj, display_name=None)#

Adds a scenario to the MultiScenario object.

Parameters:
  • scenario_obj (BaseScenario) – The scenario object to add.

  • display_name (str | None) – Optional name to identify the scenario. If not provided, uses scenario’s display_name.

get_area_charging()#

Gets area charging data for all scenarios.

Returns:

A DataFrame of area charging data for all scenarios, with an added ‘Scenario’ level in the column index.

get_area_dispatch()#

Gets area dispatch data for all scenarios.

Returns:

A DataFrame of area dispatch data for all scenarios, with an added ‘Scenario’ level in the column index.

get_area_unserved()#

Gets area unserved energy data for all scenarios.

Returns:

A DataFrame of area unserved energy data for all scenarios, with an added ‘Scenario’ level in the column index.

get_availability()#

Gets availability data for all scenarios.

Returns:

A DataFrame of availability data for all scenarios, with an added ‘Scenario’ level in the column index.

get_generation()#

Gets generation data for all scenarios.

Returns:

A DataFrame of generation data for all scenarios, with an added ‘Scenario’ level in the column index.

get_generation_capacity()#

Gets generation capacity data for all scenarios.

Returns:

A DataFrame of generation capacity data for all scenarios, with ‘Scenario’ as an additional column.

get_generators_tech()#

Gets generation data with technology information for all scenarios.

Returns:

A DataFrame of generation data with technology for all scenarios, with an added ‘Scenario’ level in the column index.

get_line_flow()#

Gets line flow data for all scenarios.

Returns:

A DataFrame of line flow data for all scenarios, with an added ‘Scenario’ level in the column index.

get_load()#

Gets load data for all scenarios.

Returns:

A DataFrame of load data for all scenarios, with an added ‘Scenario’ level in the column index.

get_production_cost()#

Gets production cost data for all scenarios.

Returns:

A DataFrame of production cost data for all scenarios, with an added ‘Scenario’ level in the column index.

get_storage_charging()#

Gets storage charging data for all scenarios.

Returns:

A DataFrame of storage charging data for all scenarios, with an added ‘Scenario’ level in the column index.

get_system_dispatch()#

Gets system dispatch data for all scenarios.

Returns:

A DataFrame of system dispatch data for all scenarios, with an added ‘Scenario’ level in the column index.

get_unserved()#

Gets unserved energy data for all scenarios.

Returns:

A DataFrame of unserved energy data for all scenarios, with an added ‘Scenario’ level in the column index.