Specific research projects (project)

ADVANCE (project.advance)

Although free of charge, the ADVANCE data can not be downloaded automatically. This source requires that users first submit personal information to register before being able to retrieve the data. message_ix_models does not circumvent this requirement. Thus:

  • A copy of the data are stored in message_data.

  • message_ix_models contains only a ‘fuzzed’ version of the data (same structure, random values) for testing purposes.

class message_ix_models.project.advance.data.ADVANCE(source, source_kw)[source]

Provider of exogenous data from the ADVANCE project database.

To use data from this source, call exo_data.prepare_computer() with the arguments:

  • source: “ADVANCE”

  • source_kw including:

    • “model”: one of 12 codes including “MESSAGE”.

    • “measure”: one of 3080 codes for the “VARIABLE” dimension.

    • “scenario”: one of 51 codes including “ADV3TRAr2_Base”.

    • “name”, optional: override ExoDataSource.name.

    • “aggregate”, optional: if True, aggregate data from the ADVANCE native regions using n::groups (same behaviour as the base class). Otherwise, do not aggregate.

Example

>>> keys = prepare_computer(
...     context,
...     computer,
...     source="ADVANCE",
...     source_kw=dict(
...         measure="Transport|Service demand|Road|Freight",
...         model="MESSAGE",
...         scenario="ADV3TRAr2_Base",
...     ),
... )
>>> result = computer.get(keys[0])

Load the metadata packaged with message_ix_models to identify usable source_kw:

>>> import sdmx
>>> from message_ix_models.util import package_data_path
>>>
>>> msg = sdmx.read_sdmx(package_data_path("sdmx", "ADVANCE.xml"))
>>> msg
<sdmx.StructureMessage>
<Header>
    prepared: '2023-11-03T21:51:46.052879'
    source: en: Generated by message_ix_models 2023.9.13.dev57+ga558c0b4.d20231011
    test: False
Codelist (5): MODEL SCENARIO REGION VARIABLE UNIT
>>> msg.codelist["MODEL].items
{'AIM/CGE': <Code AIM/CGE>,
 'DNE21+': <Code DNE21+>,
 'GCAM': <Code GCAM>,
 'GEM-E3': <Code GEM-E3>,
 'IMACLIM V1.1': <Code IMACLIM V1.1>,
 'IMAGE': <Code IMAGE>,
 'MESSAGE': <Code MESSAGE>,
 'POLES ADVANCE': <Code POLES ADVANCE>,
 'REMIND': <Code REMIND>,
 'TIAM-UCL': <Code TIAM-UCL>,
 'WITCH': <Code WITCH>,
 'iPETS V.1.5': <Code iPETS V.1.5>}
id: str = 'ADVANCE'

Identifier for this particular source.

transform(c: Computer, base_key: Key) Key[source]

Prepare c to transform raw data from base_key.

Unlike the base class version, this implementation only adds the aggregation step if aggregate is True.

Shared Socioeconomic Pathways (project.ssp)

Structure

The enumerations SSP_2017 and SSP_2024 contain one member from the corresponding SDMX code lists. These can be used to uniquely identify both an SSP narrative and the set in which it occurs, in applications where this distinction is meaningful:

>>> from message_ix_models.project.ssp import SSP_2017, SSP_2024
>>> x = SSP_2017["2"]
>>> y = SSP_2024["2"]
>>> str(y)
"ICONICS:SSP(2024).2"
>>> x == y
False
message_ix_models.project.ssp.SSP

alias of ICONICS:SSP(2017)

message_ix_models.project.ssp.SSP_2017

alias of ICONICS:SSP(2017)

message_ix_models.project.ssp.SSP_2024

alias of ICONICS:SSP(2024)

message_ix_models.project.ssp.generate(context: Context, base_dir: PathLike | None = None)[source]

Generate SDMX code lists containing the SSPs.

message_ix_models.project.ssp.parse(value: str | ~message_ix_models.util.sdmx.ICONICS:SSP(2017) | ~message_ix_models.util.sdmx.ICONICS:SSP(2024)) -> ~message_ix_models.util.sdmx.ICONICS:SSP(2017) | ~message_ix_models.util.sdmx.ICONICS:SSP(2024)[source]

Parse value to a member of SSP_2017 or SSP_2024.

class message_ix_models.project.ssp.ssp_field(default: ~message_ix_models.util.sdmx.ICONICS:SSP(2017) | ~message_ix_models.util.sdmx.ICONICS:SSP(2024))[source]

SSP field for use in data classes.

Data

Although free of charge, neither the 2017 or 2024 SSP data can be downloaded automatically. Both sources require that users first submit personal information to register before being able to retrieve the data. message_ix_models does not circumvent this requirement. Thus:

  • A copy of the data are stored in message_data.

  • message_ix_models contains only a ‘fuzzed’ version of the data (same structure, random values) for testing purposes.

Todo

Allow users without access to message_data to read a local copy of this data from a Config.local_data subdirectory.

SSPOriginal(source, source_kw)

Provider of exogenous data from the original SSP database.

SSPUpdate(source, source_kw)

Provider of exogenous data from the SSP Update database.

class message_ix_models.project.ssp.data.SSPOriginal(source, source_kw)[source]

Provider of exogenous data from the original SSP database.

To use data from this source, call exo_data.prepare_computer() with the arguments:

  • source: Any value from SSP_2017 or equivalent string, for instance “ICONICS:SSP(2017).2”. The specific SSP for which data is returned is determined from the value.

  • source_kw including:

    • “model”: one of:

      • IIASA GDP

      • IIASA-WiC POP

      • NCAR

      • OECD Env-Growth

      • PIK GDP-32

    • “measure”: The measures available differ according to the model; see the source data for details.

Example

>>> keys = prepare_computer(
...     context,
...     computer,
...     source="ICONICS:SSP(2015).3",
...     source_kw=dict(measure="POP", model="IIASA-WiC POP"),
... )
>>> result = computer.get(keys[0])
filename = 'SspDb_country_data_2013-06-12.csv.zip'

Name of file containing the data.

id: str = 'SSP'

Identifier for this particular source.

model_date = {'IIASA GDP': '130219', 'IIASA-WiC POP': '130115', 'NCAR': '130115', 'OECD Env-Growth': '130325', 'PIK GDP-32': '130424'}

One-to-one correspondence between “model” codes and date fragments in scenario codes.

replace = {'billion US$2005/yr': 'billion USD_2005/yr'}

Replacements to apply when loading the data.

class message_ix_models.project.ssp.data.SSPUpdate(source, source_kw)[source]

Provider of exogenous data from the SSP Update database.

To use data from this source, call exo_data.prepare_computer() with the arguments:

  • source: Any value from SSP_2024 or equivalent string, for instance “ICONICS:SSP(2024).2”.

  • release: One of “3.0” or “preview”.

Example

>>> keys = prepare_computer(
...     context,
...     computer,
...     source="ICONICS:SSP(2024).3",
...     source_kw=dict(measure="GDP", model="IIASA GDP 2023"),
... )
>>> result = computer.get(keys[0])
filename = {'3.0': '1706548837040-ssp_basic_drivers_release_3.0_full.csv.gz', 'preview': 'SSP-Review-Phase-1.csv.gz'}

File names containing the data, according to the release.

id: str = 'SSP update'

Identifier for this particular source.