T-reX.FutureScenarios

This module is responsible for creating future databases with premise.

Attributes

dir_premise

Functions

make_possible_scenario_list(filenames, ...)

Make a list of dictionaries with scenario details based on the available scenarios and the desired scenarios.

check_existing(desired_scenarios)

Check the project to see if the desired scenarios already exist, and if so, remove them from the list of scenarios to be created.

FutureScenarios(scenario_list)

Create future databases with premise.

MakeFutureScenarios()

Main function to run the FutureScenarios module.

Module Contents

T-reX.FutureScenarios.dir_premise
T-reX.FutureScenarios.make_possible_scenario_list(filenames, desired_scenarios, years)[source]

Make a list of dictionaries with scenario details based on the available scenarios and the desired scenarios.

args: filenames (list): list of filenames of available scenarios desired_scenarios (list): list of dictionaries with scenario details years (list): list of years to be used

returns: scenarios (list): list of dictionaries with scenario details that are available and desired

T-reX.FutureScenarios.check_existing(desired_scenarios)[source]

Check the project to see if the desired scenarios already exist, and if so, remove them from the list of scenarios to be created. Quite useful when running many scenarios, as it can take a long time to create them all, sometimes crashes, etc.

args: desired_scenarios (list): list of dictionaries with scenario details

returns: new_scenarios (list): list of dictionaries with scenario details that do not already exist in the project

T-reX.FutureScenarios.FutureScenarios(scenario_list)[source]

Create future databases with premise.

This function processes scenarios and creates new databases based on the premise module. It configures and uses user-defined settings and parameters for database creation and scenario processing.

Returns:

None The function does not return any value but performs operations to create and configure databases in Brightway2 based on specified scenarios.

Raises:

Exception – If an error occurs during the processing of scenarios or database creation.

T-reX.FutureScenarios.MakeFutureScenarios()[source]

Main function to run the FutureScenarios module. Only activated if use_premise is set to True in user_settings.py.

Calls the FutureScenarios function to create new databases based on the list of scenarios and settings specified in user_settings.py.