model.scenario

Base classes of all scenario objects

class Scenario:
Scenario()
name: str

The name of the solution (in English, e.g. 'Household & Commercial Recycling')

module_name: str

The name of the solution module (e.g. 'hcrecycling')

scenario: str

The name of the scenario

base_year: int

The base year for prognostication for this scenario. The base year may be in the past, but it marks the dividing line between what is considered 'historical' data vs 'prognosticated' data. It is also the starting point for all cumulative operations (total emissions, etc.)

The parameters that define this scenario

The ref and pds adoptions of this scenario

The base pds adoption, if this scenario uses an Existing Prognostication pds adoption (otherwise None)

The base pds adoption, if this scenario uses a Fully Customized PDS Adoption (otherwise None)

The base ref adoption, if this scenario uses a Fully Customized reference adoption (otherwise None)

The base s-curve adoption, if this scenario uses an s-curve adoption (otherwise None).

key_parameters = ['pds_2014_cost', 'soln_lifetime_capacity', 'soln_avg_annual_use', 'soln_fixed_oper_cost_per_iunit', 'soln_var_oper_cost_per_funit', 'soln_energy_efficiency_factor', 'soln_fuel_efficiency_factor', 'soln_emissions_per_funit', 'soln_indirect_co2_per_iunit']

AC scalar parameters that are most important for defining this scenario.
(Excludes adoption-related parameters.)

def key_inputs(self):
def initialize_ac(self, scenario_name_or_ac, scenario_list, default_scenario_name):

Initialize the advanced controls object for this scenario based on the various cases. The first argument may be an instantiated advanced controls argument, or a string naming the requested scenario, or None. The second argument is a list of all the available named scenarios, and the last is the default scenario to use if None is given.

def pds_ca_overrides(self, sd_high_mult=1.0, sd_low_mult=1.0):

Set values to override the default ca settings

def pds_ad_overrides( self, main_includes_regional=False, groups_include_hundred_percent=True, config_overrides=None):

config_overrides: list( tuple(param, region, value) ), where region may be '*' to change all regions

def pds_sc_overrides(self, use_tam_2014: True):
def initialize_adoption_bases(self):

Initialize the pds and ref adoption bases for this scenario to one of several different types, depending on the parameters of the scenario. Note this function only initializes the base ref and pds adoptions: the HelperTables object ht still needs to be initialized after.

Also note: if an individual solution class needs to do its own custom adoption initialization, it should do that _before_ calling initialize_adoption_bases. initialize_adoption_bases will not overwrite self.ad, self.pds_ca, etc., if they have already been initialized (except in the case of a user-supplied adoption, which does override all other options).

Returns a set of data values that are used to initialize the Helper Tables object

def adoption_limit(self):

Returns the tam or aez limitations on adoption.

def adoption_unit_increase(self, year=None, region='World'):
def marginal_first_cost(self, year=None):
def net_operating_savings(self, start_year=None, end_year=None):
def lifetime_operating_savings(self):
def cumulative_emissions_reduced(self, start_year=None, end_year=None, region='World'):
def soln_net_energy_grid_impact(self) -> pandas.core.frame.DataFrame:

The net impact of this solution on the energy grid over time relative to the reference case.
This result may be positive (if the solution requires additional electricity to operate), negative (if the adoption of this technology lowers energy use) or zero (if this solution doesn't impact the grid at all). Units: TWh

def total_energy_saving(self) -> pandas.core.frame.DataFrame:

Total energy saved by solution in EJ

def scenario_path(cls):
def update_ac(cls, ac, **newvals):
def update_adoptions(cls, scenario_names, newadoptions: pandas.core.frame.DataFrame):
class RRSScenario(Scenario):
RRSScenario()
tm: model.tam.TAM = None

The total addressable market for this solution.

def set_tam(self, config_values=None, **args):

Create the self.tm object based on the information in self._ref_tam_sources and self._pds_tam_sources.

Overrides to individual values in the tamconfig can also be specified in the config_values argument, which should be a list of tuples (param_name, region, value)

Other configuration values may be passed directly to tam.TAM via **args.

def adoption_limit(self):

Returns the tam or aez limitations on adoption.

def get_key_results(self):
def implementation_unit_adoption_increase(self, year=2050, region='World'):
def functional_unit_adoption_increase(self, year=2050, region='World'):
class LandScenario(Scenario):
LandScenario()
tla_per_region: pandas.core.frame.DataFrame = None

Total land area per region, by year. (Land area remains constant over time; this format is used because it is consistent with TAM)

key_parameters = ['soln_expected_lifetime', 'yield_gain_from_conv_to_soln', 'tco2eq_reduced_per_land_unit', 'tco2_reduced_per_land_unit', 'tch4_co2_reduced_per_land_unit', 'tn2o_co2_reduced_per_land_unit', 'land_annual_emissons_lifetime', 'seq_rate_global']

AC scalar parameters that are most important for defining this scenario.
(Excludes adoption-related parameters.)

def adoption_limit(self):

Returns the tam or aez limitations on adoption.

def get_key_results(self):
def total_additional_co2eq_sequestered(self, end_year=None):
def load_sources(jsonfile, fieldname='filename'):

Load the named jsonfile, and replace relative filenames within it with absolute ones based on the same directory. Works for tam, ad, configs. By default, replaces fields named 'filename'. If the special field name '*' is given, then _any_ string-valued dictionary value is replaced.

Now with added super-powers: detects if we are doing an integration, and if so, checks for the integration version of the same json file.

def write_sources(struct, solution_path, source_type):

Write a data sources structure out to its standard location for solution_name. Processes filename fields to write only the relative file name. Also remove any fields that have values that are not simple. This is rather hacky, and we should implement more careful control later.