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.