Reproduce the RES (model.bare)

In contrast to model.create, this module creates the RES ‘from scratch’. create_res() begins by creating a new, totally empty Scenario and adding data to it (instead of cloning and modifying an existing scenario).

Note

Currently, the Scenario returned by create_res()

  • is not complete, nor the official/preferred version of MESSAGEix-GLOBIOM, and as such must not be used for actual research,

  • however, it should be used for creating unit tests of other code that is designed to operate on MESSAGEix-GLOBIOM scenarios; code that works against the bare RES should also work against MESSAGEix-GLOBIOM scenarios.

bare.get_spec() can also be used directly, to get a description of the RES based on certain settings/options, but without any need to connect to a database, load an existing Scenario, or call bare.create_res(). This can be useful in code that processes data into a form compatible with MESSAGEix-GLOBIOM.

Context settings

Setting

Type

Description

regions

str

The ‘node’ set (regional aggregation) to use; must be “R14” (default), “R11”, “RCP” or “ISR”.

years

str

The ‘year’ set (time periods) to use; must be “B” (default) or “A”.

res_with_dummies

bool

If True, create and include dummy technologies. See get_dummy_data(). Default False

See documentation for further context settings in Top-level settings.

Code reference

message_ix_models.model.bare.SETTINGS = {'regions': ['R14', 'ADVANCE', 'ISR', 'R11', 'R12', 'R32', 'RCP'], 'res_with_dummies': [False, True], 'years': ['B', 'A']}

Settings and valid values; the default is listed first.

  • regions: recognized lists of nodes; these match the files data/node/*.yaml.

  • years: recognized lists of time periods (“years”); these match the files data/year/*.yaml

message_ix_models.model.bare.create_res(context, quiet=True)[source]

Create a ‘bare’ MESSAGEix-GLOBIOM reference energy system (RES).

Parameters
  • context (.Context) –

    Context.scenario_info determines the model name and scenario name of the created Scenario. If not provided, the defaults are:

    • Model name generated by name().

    • Scenario name “baseline”.

  • quiet (bool, optional) – Passed to quiet argument of build.apply_spec().

Returns

A scenario as described by bare.get_spec(), prepared using apply_spec().

Return type

message_ix.Scenario

message_ix_models.model.bare.name(context)[source]

Generate a candidate name for a model given context.

The name has a form like:

MESSAGEix-GLOBIOM R99 YA +D

where:

  • “R99” is the node list/regional aggregation.

  • “YA” indicates the year codelist from data/year/A.yaml is used.

  • “+D” indicates dummy set elements are included in the structure.

bare.get_spec() Mapping[str, ScenarioInfo]

Return the spec for the MESSAGE-GLOBIOM global model RES.

Return type

dict of ScenarioInfo objects

Since the RES is the base for all variants of MESSAGEix-GLOBIOM, the ‘require’ and ‘remove’ portions of the spec are empty.

For the ‘add’ section, message_ix_models.model.structure.get_codes() is used to retrieve data from the YAML files in message_ix_models.

Settings are retrieved from context, as above.

message_ix_models.model.data.get_data(scenario, context, spec, **options)[source]

Data for the bare RES.

Todo

With ixmp#212 merged, some model.bare code could be moved to a new class and method like MESSAGE_GLOBIOM.initialize().