Transport energy model projections (item.model)

On separate pages:

The sub-modules of item.model read from the Excel reporting templates (BP, ExxonMobil, IEA, ITF, and MESSAGE) or GAMS GDX file (EPPA5), and perform manipulations specific to each model.

get_model_names([version])

Return the names of all models in version.

get_model_info(name, version)

load_model_regions(name, version)

Load regions.yaml for model name in database version.

load_model_scenarios(name, version)

Load scenarios.yaml for model name in database version.

load_model_data(version[, skip_cache, …])

Load model database

item.model.concat_versions(dataframes={})[source]

Convert a dict of dataframes to a single pd.DataFrame.

The keys of dataframes are saved in a new column ‘version’.

item.model.coverage(models)[source]

Display some basic data coverage information.

item.model.load_model_data(version, skip_cache=False, cache=True, fmt=<class 'pandas.core.frame.DataFrame'>, options=[])[source]

Load model database

item.model.load_model_scenarios(name, version)[source]

Load scenarios.yaml for model name in database version.

Returns a dictionay where:

  • Keys are codes or names of scenarios.

  • Values are dictionaries with the key:

    • category: either ‘reference’ or ‘policy’.

item.model.make_regions_csv(out_file, models=None, compare=None)[source]

Produce a CSV out_file with a country→region map for models.

The table is created by parsing the regions.yaml files in the iTEM model database metadata. It is indexed by ISO 3166 (alpha-3) codes, and has one column for each model in models (if no models are specified, all models are included).

If compare is given, the table has entries only where the generated value and

item.model.make_regions_yaml(in_file, country, region, out_file)[source]

Convert a country→region map from CSV in_file to YAML out_file.

country and region are columns in in_file with country codes and region names, respectively.

item.model.select(data, *args, **kwargs)[source]

Select from data.

item.model.squash_scenarios(data, version)[source]

Replace the per-model scenario names with scenario categories.

data is a pd.DataFrame. version is the version of the iTEM model database.

item.model.to_wide(data, dimension='year')[source]

Convert data to wide format, one column per year.