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>, _code: common.Code | None = None, cost: dict = <factory>, data_source: ~message_ix_models.model.transport.config.DataSourceConfig = <factory>, demand_modes: list[str] = <factory>, dummy_demand: bool = False, dummy_LDV: bool = False, dummy_supply: bool = False, efficiency: dict = <factory>, emission_relations: bool = True, factor: dict = <factory>, fast: bool = True, fixed_GDP: ~genno.core.attrseries.AttrSeries = <factory>, fixed_pdt: ~genno.core.attrseries.AttrSeries = <factory>, load_factor: dict = <factory>, lamda: float = -2.0, ldv_cost_catch_up_year: dict = <factory>, ldv_stock_method: ~typing.Literal['A', 'B'] = 'B', minimum_activity: dict[tuple[str, tuple[str, ...], str], float] = <factory>, mode_share: str = 'default', modules: list[str] = <factory>, node_to_census_division: dict = <factory>, policy: set[Policy] = <factory>, project: dict[str, ~typing.Any] = <factory>, scaling: float = 1.0, share_weight_convergence: dict = <factory>, spec: ~message_ix_models.util.scenarioinfo.Spec = <factory>, ssp: ~message_ix_models.project.ssp.ssp_field = None, with_scenario: bool = False, with_solution: bool = False, work_hours: ~genno.core.attrseries.AttrSeries = <factory>, year_convergence: int = 2110, extra_modules: dataclasses.InitVar[str | list[str]] = None, futures_scenario: dataclasses.InitVar[str] = None, navigate_scenario: dataclasses.InitVar[str] = None)[source]
Bases:
ConfigHelperConfiguration 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>, _code: common.Code | None = None, cost: dict = <factory>, data_source: ~message_ix_models.model.transport.config.DataSourceConfig = <factory>, demand_modes: list[str] = <factory>, dummy_demand: bool = False, dummy_LDV: bool = False, dummy_supply: bool = False, efficiency: dict = <factory>, emission_relations: bool = True, factor: dict = <factory>, fast: bool = True, fixed_GDP: ~genno.core.attrseries.AttrSeries = <factory>, fixed_pdt: ~genno.core.attrseries.AttrSeries = <factory>, load_factor: dict = <factory>, lamda: float = -2.0, ldv_cost_catch_up_year: dict = <factory>, ldv_stock_method: ~typing.Literal['A', 'B'] = 'B', minimum_activity: dict[tuple[str, tuple[str, ...], str], float] = <factory>, mode_share: str = 'default', modules: list[str] = <factory>, node_to_census_division: dict = <factory>, policy: set[Policy] = <factory>, project: dict[str, ~typing.Any] = <factory>, scaling: float = 1.0, share_weight_convergence: dict = <factory>, spec: ~message_ix_models.util.scenarioinfo.Spec = <factory>, ssp: ~message_ix_models.project.ssp.ssp_field = None, with_scenario: bool = False, with_solution: bool = False, work_hours: ~genno.core.attrseries.AttrSeries = <factory>, year_convergence: int = 2110, extra_modules: dataclasses.InitVar[str | list[str]] = None, futures_scenario: dataclasses.InitVar[str] = None, navigate_scenario: dataclasses.InitVar[str] = None) None
Methods
__init__([base_model_info, _code, cost, ...])check()Check consistency of
project.from_context(context[, options])Configure context for building MESSAGEix-Transport.
from_dict(data)Construct an instance from data with name manipulation.
hexdigest([length])Return a hex digest that is unique for distinct settings on the instance.
read_file(path[, fail])Update configuration from file.
replace(**kwargs)Like
dataclasses.replace()with name manipulation.set_futures_scenario(value)Update
projectfrom a string indicating a Transport Futures scenario.set_navigate_scenario(value)Update
projectfrom a string representing a NAVIGATE scenario.update(**kwargs)Update attributes in-place.
Attributes
A
sdmx.Codefor the transport scenario.Include dummy data for LDV technologies.
Include dummy
demanddata 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
projectviaScenarioFlags.parse_futures().‘Full’ label used in the scenario name.
Logit share exponents or cost distribution parameters [0]
Method for calibrating LDV stock and sales:
Base year shares of activity by mode.
Identifiers of NAVIGATE T3.5 demand-side scenarios, used to update
projectviaScenarioFlags.parse_navigate().Scaling factors for production function [0]
Enum member indicating a Shared Socioeconomic Pathway, if any, to use for exogenous data.
Trueif a base model or MESSAGEix-Transport scenario (possibly with solution data) is available.Trueif solution data is available.Year for share convergence.
Information about the base model.
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 factors for vehicles [tonne km per vehicle km].
Period in which LDV costs match those of a reference region.
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.Instances of
Policysubclasses applicable in a workflow or to a scenario.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.yamlandtechnology.yaml.Work hours per year, used to compute the value of time.
- base_model_info: ScenarioInfo
Information about the base model.
- property code: common.Code
A
sdmx.Codefor the transport scenario..code.idis a short label suitable for aWorkflowstep name, for instance “SSP3 policy” or “SSP5”. Seetransport.workflow.generate().code can be set either using a Code instance with
ScenarioCodeAnnotations—such as fromget_cl_scenario()—or the ID of a item in this particular code list. When set, other Config attributes are also updated:base_scenario_url: perScenarioCodeAnnotations.base_scenario_URL.project: the “DIGSY”, “EDITS”, and “LED” keys are set perScenarioCodeAnnotations.DIGSY_scenario_URN,EDITS_scenario_URN, andis_LED_scenario, respectively.
- cost: dict
Scaling factors for costs.
ldv ngaScaling 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 invInvestment costs of bus technologies, relative to the cost of
ICG_bus. Dictionary with 1 key perBUStechnology.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[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, options: dict | None = None) Config[source]
Configure context for building MESSAGEix-Transport.
context.transportis set to an instance ofConfig.Configuration files and metadata are read and override the class defaults.
The files listed in
METADATAare stored in the respective attributes for instancesetcorresponding todata/transport/set.yaml.If a subdirectory of
data/transport/exists corresponding tocontext.model.regions(model.Config.regions), then the files are loaded from that subdirectory, for instancedata/transport/ISR/set.yamlis preferred todata/transport/set.yaml.Note
This method previously had behaviour similar to
model.Config.regions_from_scenario(). Calling code should call that method if it is needed to ensure thatmodel.Config.regionshas the desired value.
- futures_scenario: dataclasses.InitVar[str] = None
Identifier of a Transport Futures scenario, used to update
projectviaScenarioFlags.parse_futures().
- hexdigest(length: int = -1) str
Return a hex digest that is unique for distinct settings on the instance.
Uses
dataclasses.asdict(). This means that if the names of fields defined by a subclass change—including if fields are added or removed—the result will differ. The returned value should be the same across versions of Python.- Returns:
If length is greater than 0, a string of this length; otherwise a 32-character string from
blake2s.hexdigest().- Return type:
- property label: str
‘Full’ label used in the scenario name.
Compared to
code.id, this is a longer, more explicit label, suitable for (part of) amessage_ix.Scenario.scenarioname in anixmpdatabase, for instance “SSP_2024.3”.
- 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 fromldv-new-capacity.csv, if it exists."B": use func:.ldv.stock; see the function documentation.
- load_factor: dict
Load factors for vehicles [tonne km per vehicle km].
F ROAD: similar to IEA “Future of Trucks” (2017) values; see .transport.freight. Alternately use 5.0, similar to Roadmap 2017 values.
- 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
projectviaScenarioFlags.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.
- project: dict[str, Any]
Flags for distinct scenario features according to projects. In addition to providing values directly, this can be set by passing
futures_scenarioornavigate_scenarioto the constructor, or by callingset_futures_scenario()orset_navigate_scenario()on an existing Config instance.transport.buildandtransport.reportcode will respond to these settings in documented ways.
- read_file(path: Path, fail='raise') None
Update configuration from file.
- Parameters:
path – to a
.yamlfile 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. Otherwise, a message is logged.
- replace(**kwargs)
Like
dataclasses.replace()with name manipulation.
- set_futures_scenario(value: str | None) None[source]
Update
projectfrom a string indicating a Transport Futures scenario.See
ScenarioFlags.parse_futures(). This method altersmode_shareandfixed_demandaccording to the value (if any).
Update
projectfrom 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.yamlandtechnology.yaml.
- 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
Trueif 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.