Model configuration validation

G-Cubed loads one UTF-8 YAML mapping and validates it against the packaged schema. Model and filesystem checks then run at the relevant loading or execution boundary; monetary-tuning region membership is checked when tuning runs.

Common errors include:

  • an unquoted build number;
  • duplicate or unknown keys;
  • explicit null where a value must be omitted instead;
  • anchors, aliases, merge keys or custom tags;
  • quoted numbers or booleans;
  • unsafe filenames containing directories;
  • years in the wrong order;
  • a feature without its required mapping;
  • a region code not present in the model; and
  • an electricity-distribution sector that differs from the sole corresponding member declared by the processed SYM model; and
  • a partial baseline-tuning regional override; and
  • an invalid or mixed monetary exclusion override.

Read the error path

An error path such as baseline_tuning.real_interest_rates_in_base_year.region_overrides.LKA identifies the part of the YAML to correct. Fix the first reported structural error before interpreting later model-aware errors.

For an electricity-model mismatch, the model-aware check identifies electricity_distribution_sector and reports both the configured code and the SYM member it expected. Use the sector identifier from the model’s sec_ed declaration, rather than a GTAP or Ember mapping label.

Monetary exclusion errors

A monetary regional override is either a complete transition or exactly {exclude: true}. The exclusion form requires the implementing unreleased modified Python G-Cubed 5.0.2.0 source, while schema_version remains 1. See the monetary-policy recipes for valid examples and file-preservation behavior.

Structural errors are rejected while loading YAML, even if tuning will run in disabled mode:

Invalid entry or location Correction
OIL: {exclude: false}, {exclude: null}, {exclude: "true"} or {exclude: 1} Use only the native YAML boolean true
OIL: {exclude: true, start_year: 2023} or any other transition field beside exclude Choose the exact exclusion form or a complete transition
OIL: null, OIL: false or OIL: {} Supply one of the two valid mappings
Duplicate OIL keys, including one transition and one exclusion Keep one regional entry
Exclusion under monetary defaults or real-interest-rate tuning Use exclusions only under monetary region_overrides
excluded_regions or another extra key Use the existing monetary region_overrides mapping

For the regional form, the error identifies the path baseline_tuning.monetary_policy_adjustments.region_overrides.OIL (and the offending field where available). A null starting_intx_value inside a complete transition remains valid and requests a calculated starting value.

Unknown and wrong-case region keys are a separate tuning-time error. When summary or apply runs, the error identifies baseline_tuning.monetary_policy_adjustments.region_overrides and the offending codes before any diagnostic or model-input write, including when every entry is an exclusion. Use exact identifiers from the selected model: OIL and MEN belong to different aggregations and are not interchangeable. The tuner does not infer exclusions from monetary closures or exchange-rate pegs.

Growth input errors

The growth setting accepts a finite YAML number in percentage log-growth units, at least zero and less than 100. A quoted "1.4", boolean or nonfinite value is invalid. A literal 0.014 is accepted as 0.014 per cent; it is not recognized as a historical input automatically. Follow the joint migration instructions for older configurations and CSVs. Schema version remains 1.

At least 50 configured projection years are required. The advancement CSV must cover those years and the model’s sectors without duplicates. All selected cells must be finite numbers, all resolved frontier rates must be nonnegative, and every sector must have exact zeros from last_projection - 49 through last_projection.

For example, in a projection ending in 2200, a deviation 0.6 at a01,2151 violates the protected 2151–2200 range even though its resolved frontier growth is valid. The error reports the file path, range, total number of offending cells and bounded sector/year/value examples. A nonzero cell in 2150 is outside that protected range. Fix source assumptions explicitly; the loader does not flatten, round or taper the tail.

Preserved generated inputs and cached solutions must agree with the current growth assumptions. When a consistency check fails, use the regeneration instructions.

Start from a working build

For a complete maintained example, inspect models/2A/200/model_configuration.yaml. Copy only into another model after checking its version, regions, sectors, mappings and features.

Back to model configuration YAML