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_lifetime: ~genno.core.attrseries.AttrSeries = <factory>, 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 (viafrom_context()
) loading configuration and values from files likeconfig.yaml
, while respecting higher-level configuration, for instancemodel.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_lifetime: ~genno.core.attrseries.AttrSeries = <factory>, 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
Include dummy
demand
data for testing and debugging.Include dummy technologies supplying commodities required by transport, for testing and debugging.
Generate relation entries for emissions.
Extra entries for
modules
, supplied to the constructor.If
True
(the default), do not record/preserve parameter data when removing set elements from the base model.Identifier of a Transport Futures scenario, used to update
project
viaScenarioFlags.parse_futures()
.Logit share exponents or cost distribution parameters [0]
Base year shares of activity by mode.
Identifiers of NAVIGATE T3.5 demand-side scenarios, used to update
project
viaScenarioFlags.parse_navigate()
.indicates whether the base scenario used is a policy (carbon pricing) scenario, or not.
Scaling factors for production function [0]
Enum member indicating a Shared Socioeconomic Pathway, if any, to use for exogenous data.
True
if a base model or MESSAGEix-Transport scenario (possibly with solution data) is available.True
if solution data is available.Year for share convergence.
Information about the base model.
Values for constraints.
Scaling factors for costs.
Sources for input data.
Set of modes handled by demand projection.
Various efficiency factors.
Various other factors.
Fixed future point for total passenger activity.
Fixed future point for total passenger activity.
load_factor
Period in which LDV costs match those of a reference region.
Lifetime of light duty vehicles.
Tuples of (node, technology (transport mode), commodity) for which minimum activity should be enforced.
List of modules containing model-building calculations.
Used by
get_USTIMES_MA3T()
to map MESSAGE regions to U.S.Flags for distinct scenario features according to projects.
Mapping from nodes to other nodes towards which share weights should converge.
Specification for the structure of MESSAGEix-Transport, processed from contents of
set.yaml
andtechnology.yaml
.Speeds of transport modes.
Work hours per year, used to compute the value of time.
- base_model_info: ScenarioInfo
Information about the base model.
- 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 perBUS
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_supply: bool = False
Include dummy technologies supplying commodities required by transport, for testing and debugging.
- 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 frommodules
.
- 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.
If scenario is given,
context.model.regions
is updated to match. Seeidentify_nodes()
.context.transport
is set to an instance ofConfig
.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 todata/transport/set.yaml
.If a subdirectory of
data/transport/
exists corresponding tocontext.model.regions
then the files are loaded from that subdirectory, for instancedata/transport/ISR/set.yaml
is preferred todata/transport/set.yaml
.
- futures_scenario: dataclasses.InitVar[str] = None
Identifier of a Transport Futures scenario, used to update
project
viaScenarioFlags.parse_futures()
.
- ldv_cost_catch_up_year: Dict
Period in which LDV costs match those of a reference region. Dimensions: (node,).
- ldv_lifetime: AttrSeries
Lifetime of light duty vehicles. Dimensions: (consumer type,). Units: [time].
- 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()
.
Base year shares of activity by mode. This should be the stem of a CSV file in the directory
data/transport/regions/mode-share/
.
Identifiers of NAVIGATE T3.5 demand-side scenarios, used to update
project
viaScenarioFlags.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 viabase_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
ornavigate_scenario
to the constructor, or by callingset_futures_scenario()
orset_navigate_scenario()
on an existing Config instance.transport.build
andtransport.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.
- set_futures_scenario(value: str | None) None [source]
Update
project
from a string indicating a Transport Futures scenario.See
ScenarioFlags.parse_futures()
. This method altersmode_share
andfixed_demand
according to the value (if any).
Update
project
from a string representing a NAVIGATE scenario.See
ScenarioFlags.parse_navigate()
.
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
andtechnology.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.
- work_hours: AttrSeries
Work hours per year, used to compute the value of time.