message_ix_models.model.transport.config.Config

class message_ix_models.model.transport.config.Config(base_model_info: ~message_ix_models.util.scenarioinfo.ScenarioInfo = <factory>, constraint: ~typing.Dict = <factory>, cost: ~typing.Dict = <factory>, data_source: ~message_ix_models.model.transport.config.DataSourceConfig = <factory>, demand_modes: ~typing.List[str] = <factory>, dummy_demand: bool = False, dummy_supply: bool = False, efficiency: ~typing.Dict = <factory>, emission_relations: bool = True, factor: ~typing.Dict = <factory>, fast: bool = True, fixed_GDP: ~genno.core.attrseries.AttrSeries = <factory>, fixed_pdt: ~genno.core.attrseries.AttrSeries = <factory>, load_factor: ~typing.Dict = <factory>, lamda: float = -2.0, ldv_cost_catch_up_year: ~typing.Dict = <factory>, ldv_stock_method: ~typing.Literal['A', 'B'] = 'B', minimum_activity: ~typing.Dict[~typing.Tuple[str, ~typing.Tuple[str, ...], str], float] = <factory>, mode_share: str = 'default', modules: ~typing.List[str] = <factory>, node_to_census_division: ~typing.Dict = <factory>, policy: bool = False, project: ~typing.Dict[str, ~enum.Enum] = <factory>, scaling: float = 1.0, share_weight_convergence: ~typing.Dict = <factory>, spec: ~message_ix_models.util.scenarioinfo.Spec = <factory>, speeds: ~genno.core.attrseries.AttrSeries = <factory>, ssp: ~message_ix_models.project.ssp.ssp_field | None = None, with_scenario: bool = False, with_solution: bool = False, work_hours: ~genno.core.attrseries.AttrSeries = <factory>, year_convergence: int = 2110, extra_modules: dataclasses.InitVar[typing.Union[str, typing.List[str]]] | None = None, futures_scenario: dataclasses.InitVar[str] | None = None, navigate_scenario: dataclasses.InitVar[str] | None = None)[source]

Bases: ConfigHelper

Configuration for MESSAGEix-Transport.

This dataclass stores and documents all configuration settings required and used by transport. It also handles (via from_context()) loading configuration and values from files like config.yaml, while respecting higher-level configuration, for instance model.Config.regions.

__init__(base_model_info: ~message_ix_models.util.scenarioinfo.ScenarioInfo = <factory>, constraint: ~typing.Dict = <factory>, cost: ~typing.Dict = <factory>, data_source: ~message_ix_models.model.transport.config.DataSourceConfig = <factory>, demand_modes: ~typing.List[str] = <factory>, dummy_demand: bool = False, dummy_supply: bool = False, efficiency: ~typing.Dict = <factory>, emission_relations: bool = True, factor: ~typing.Dict = <factory>, fast: bool = True, fixed_GDP: ~genno.core.attrseries.AttrSeries = <factory>, fixed_pdt: ~genno.core.attrseries.AttrSeries = <factory>, load_factor: ~typing.Dict = <factory>, lamda: float = -2.0, ldv_cost_catch_up_year: ~typing.Dict = <factory>, ldv_stock_method: ~typing.Literal['A', 'B'] = 'B', minimum_activity: ~typing.Dict[~typing.Tuple[str, ~typing.Tuple[str, ...], str], float] = <factory>, mode_share: str = 'default', modules: ~typing.List[str] = <factory>, node_to_census_division: ~typing.Dict = <factory>, policy: bool = False, project: ~typing.Dict[str, ~enum.Enum] = <factory>, scaling: float = 1.0, share_weight_convergence: ~typing.Dict = <factory>, spec: ~message_ix_models.util.scenarioinfo.Spec = <factory>, speeds: ~genno.core.attrseries.AttrSeries = <factory>, ssp: ~message_ix_models.project.ssp.ssp_field | None = None, with_scenario: bool = False, with_solution: bool = False, work_hours: ~genno.core.attrseries.AttrSeries = <factory>, year_convergence: int = 2110, extra_modules: dataclasses.InitVar[typing.Union[str, typing.List[str]]] | None = None, futures_scenario: dataclasses.InitVar[str] | None = None, navigate_scenario: dataclasses.InitVar[str] | None = None) None

Methods

__init__([base_model_info, constraint, ...])

check()

Check consistency of project.

from_context(context[, scenario, options])

Configure context for building MESSAGEix-Transport.

from_dict(data)

Construct an instance from data with name manipulation.

read_file(path[, fail])

Update configuration from file.

replace(**kwargs)

Like dataclasses.replace() with name manipulation.

set_futures_scenario(value)

Update project from a string indicating a Transport Futures scenario.

set_navigate_scenario(value)

Update project from a string representing a NAVIGATE scenario.

update(**kwargs)

Update attributes in-place.

Attributes

dummy_demand

Include dummy demand data for testing and debugging.

dummy_supply

Include dummy technologies supplying commodities required by transport, for testing and debugging.

emission_relations

Generate relation entries for emissions.

extra_modules

Extra entries for modules, supplied to the constructor.

fast

If True (the default), do not record/preserve parameter data when removing set elements from the base model.

futures_scenario

Identifier of a Transport Futures scenario, used to update project via ScenarioFlags.parse_futures().

lamda

Logit share exponents or cost distribution parameters [0]

ldv_stock_method

Method for calibrating LDV stock and sales:

mode_share

Base year shares of activity by mode.

navigate_scenario

Identifiers of NAVIGATE T3.5 demand-side scenarios, used to update project via ScenarioFlags.parse_navigate().

policy

indicates whether the base scenario used is a policy (carbon pricing) scenario, or not.

scaling

Scaling factors for production function [0]

ssp

Enum member indicating a Shared Socioeconomic Pathway, if any, to use for exogenous data.

with_scenario

True if a base model or MESSAGEix-Transport scenario (possibly with solution data) is available.

with_solution

True if solution data is available.

year_convergence

Year for share convergence.

base_model_info

Information about the base model.

constraint

Values for constraints.

cost

Scaling factors for costs.

data_source

Sources for input data.

demand_modes

Set of modes handled by demand projection.

efficiency

Various efficiency factors.

factor

Various other factors.

fixed_GDP

Fixed future point for total passenger activity.

fixed_pdt

Fixed future point for total passenger activity.

load_factor

ldv_cost_catch_up_year

Period in which LDV costs match those of a reference region.

minimum_activity

Tuples of (node, technology (transport mode), commodity) for which minimum activity should be enforced.

modules

List of modules containing model-building calculations.

node_to_census_division

Used by get_USTIMES_MA3T() to map MESSAGE regions to U.S.

project

Flags for distinct scenario features according to projects.

share_weight_convergence

Mapping from nodes to other nodes towards which share weights should converge.

spec

Specification for the structure of MESSAGEix-Transport, processed from contents of set.yaml and technology.yaml.

speeds

Speeds of transport modes.

work_hours

Work hours per year, used to compute the value of time.

base_model_info: ScenarioInfo

Information about the base model.

check()[source]

Check consistency of project.

constraint: Dict

Values for constraints.

“LDV growth_activity_lo”, “LDV growth_activity_up”

Allowable annual decrease or increase (respectively) in activity of each LDV technology. For example, a value of 0.01 means the activity may increase by 1% from one year to the next. For periods of length >1 year, MESSAGE compounds the value. Defaults are multiples of 0.0192 = (1.1 ^ 0.2) - 1.0; or ±10% each 5 years. See ldv.constraint_data().

“non-LDV growth_new_capacity_up”

Allowable annual increase in new capacity (roughly, sales) of each technology for transport modes other than LDV. See non_ldv.growth_new_capacity().

“* initial_*_up”

Base value for growth constraints. These values are arbitrary.

cost: Dict

Scaling factors for costs.

ldv nga

Scaling factor to reduce the cost of NGA vehicles.

Note

DLM: “applied to the original US-TIMES cost data. That original data simply seems too high - much higher than conventional gasoline vehicles in the base-year and in future, which is strange.

bus inv

Investment costs of bus technologies, relative to the cost of ICG_bus. Dictionary with 1 key per BUS technology.

  • Used in ikarus.py

  • This is from the IKARUS data in GEAM_TRP_Technologies.xlsx; sheet ‘updateTRPdata’, with the comment “Original data from Sei (PAO).”

  • This probably refers to some source that gave relative costs of different buses, in PAO, for this year; it is applied across all years.

data_source: DataSourceConfig

Sources for input data.

demand_modes: List[str]

Set of modes handled by demand projection. This list must correspond to groups specified in the corresponding technology.yaml file.

Todo

Read directly from technology.yaml

dummy_demand: bool = False

Include dummy demand data for testing and debugging.

dummy_supply: bool = False

Include dummy technologies supplying commodities required by transport, for testing and debugging.

efficiency: Dict

Various efficiency factors.

emission_relations: bool = True

Generate relation entries for emissions.

extra_modules: dataclasses.InitVar[Union[str, List[str]]] = None

Extra entries for modules, supplied to the constructor. May be either a space-delimited string ("module_a -module_b") or sequence of strings. Values prefixed with a hyphen ("-module_b") are removed from modules.

factor: Dict

Various other factors.

fast: bool = True

If True (the default), do not record/preserve parameter data when removing set elements from the base model.

fixed_GDP: AttrSeries

Fixed future point for total passenger activity.

fixed_pdt: AttrSeries

Fixed future point for total passenger activity.

AJ: Assuming mean speed of the high-speed transport is 330 km/h leads to 132495 passenger km / capita / year (Schafer & Victor 2000). Original comment (DLM): “Assume only half the speed (330 km/h) and not as steep a curve.”

classmethod from_context(context: Context, scenario: Scenario | None = None, options: Dict | None = None) Config[source]

Configure context for building MESSAGEix-Transport.

  1. If scenario is given, context.model.regions is updated to match. See identify_nodes().

  2. context.transport is set to an instance of Config.

    Configuration files and metadata are read and override the class defaults.

    The files listed in METADATA are stored in the respective attributes, e.g. set corresponding to data/transport/set.yaml.

    If a subdirectory of data/transport/ exists corresponding to context.model.regions then the files are loaded from that subdirectory, for instance data/transport/ISR/set.yaml is preferred to data/transport/set.yaml.

classmethod from_dict(data: Mapping)

Construct an instance from data with name manipulation.

futures_scenario: dataclasses.InitVar[str] = None

Identifier of a Transport Futures scenario, used to update project via ScenarioFlags.parse_futures().

lamda: float = -2.0

Logit share exponents or cost distribution parameters [0]

ldv_cost_catch_up_year: Dict

Period in which LDV costs match those of a reference region. Dimensions: (node,).

ldv_stock_method: Literal['A', 'B'] = 'B'

Method for calibrating LDV stock and sales:

  • "A": use data from ldv-new-capacity.csv, if it exists.

  • "B": use func:.ldv.stock; see the function documentation.

minimum_activity: Dict[Tuple[str, Tuple[str, ...], str], float]

Tuples of (node, technology (transport mode), commodity) for which minimum activity should be enforced. See non_ldv.bound_activity_lo().

mode_share: str = 'default'

Base year shares of activity by mode. This should be the stem of a CSV file in the directory data/transport/regions/mode-share/.

modules: List[str]

List of modules containing model-building calculations.

navigate_scenario: dataclasses.InitVar[str] = None

Identifiers of NAVIGATE T3.5 demand-side scenarios, used to update project via ScenarioFlags.parse_navigate().

node_to_census_division: Dict

Used by get_USTIMES_MA3T() to map MESSAGE regions to U.S. census divisions appearing in MA³T.

policy: bool = False

indicates whether the base scenario used is a policy (carbon pricing) scenario, or not. This currently does not affect any behaviour of transport except the selection of a base scenario via base_scenario_url().

Type:

Temporary setting for the SSP 2024 project

project: Dict[str, Enum]

Flags for distinct scenario features according to projects. In addition to providing values directly, this can be set by passing futures_scenario or navigate_scenario to the constructor, or by calling set_futures_scenario() or set_navigate_scenario() on an existing Config instance.

transport.build and transport.report code will respond to these settings in documented ways.

read_file(path: Path, fail='raise') None

Update configuration from file.

Parameters:
  • path – to a .yaml file containing a top-level mapping.

  • fail (str) – if “raise” (the default), any names in path which do not match attributes of the dataclass raise a ValueError. Ottherwise, a message is logged.

replace(**kwargs)

Like dataclasses.replace() with name manipulation.

scaling: float = 1.0

Scaling factors for production function [0]

set_futures_scenario(value: str | None) None[source]

Update project from a string indicating a Transport Futures scenario.

See ScenarioFlags.parse_futures(). This method alters mode_share and fixed_demand according to the value (if any).

set_navigate_scenario(value: str | None) None[source]

Update project from a string representing a NAVIGATE scenario.

See ScenarioFlags.parse_navigate().

share_weight_convergence: Dict

Mapping from nodes to other nodes towards which share weights should converge.

spec: Spec

Specification for the structure of MESSAGEix-Transport, processed from contents of set.yaml and technology.yaml.

speeds: AttrSeries

Speeds of transport modes. The labels on the ‘t’ dimension must match demand_modes. Source: Schäefer et al. (2010)

Note

Temporarily ignored for PR #551; data are read instead from speed.csv.

ssp: ssp_field = None

Enum member indicating a Shared Socioeconomic Pathway, if any, to use for exogenous data.

update(**kwargs)

Update attributes in-place.

Raises:

AttributeError – Any of the kwargs are not fields in the data class.

with_scenario: bool = False

True if a base model or MESSAGEix-Transport scenario (possibly with solution data) is available.

with_solution: bool = False

True if solution data is available.

work_hours: AttrSeries

Work hours per year, used to compute the value of time.

year_convergence: int = 2110

Year for share convergence.