Setting up baselines and experiments

Build 199 uses a standalone setup.yaml and the standard small setup.py entry point. Setup generates declared artefacts; it does not generate or configure run scripts.

Related YAML documentation: setup YAML, generated layers, shock projections, design generation and chartpack generation.

Create setup.py

from pathlib import Path

from gcubed.experiments import generate_setup_artefacts


if __name__ == "__main__":
    generate_setup_artefacts(Path(__file__))

Users normally run this file without editing it.

Create setup.yaml

A standard experiment can declare a member group, one generated layer, one design and one chartpack:

schema_version: 1
kind: experiment
model:
  configuration_file_name: model_configuration.yaml

member_groups:
  selected_regions:
    members: [USA, CHN]

layers:
  - id: policy_adjustment
    name: Policy adjustment
    data_file_name: policy_adjustment.csv
    event_year: 2026
    description: Raise selected inflation targets
    shocks:
      - variable_prefix: INFX
        variable_type: exo
        selectors:
          - dimension: regions
            member_group: selected_regions
        value_path:
          type: permanent_constant
          value: 1.0
          units: percentage points

artefacts:
  design_file_name: design.yaml
design:
  name: Policy experiment
  layer_ids: [policy_adjustment]

chartpack:
  title: Policy experiment
  charts:
    - variable_prefix: INFL
      selectors:
        - dimension: regions
          member_group: selected_regions

Generate and inspect

Open a terminal in the simulation directory and run:

python setup.py

Inspect policy_adjustment.csv, design.yaml and chartpack.yaml. If any declaration fails validation, setup changes none of the generated files.

Run separately

The maintained run_experiment.py owns runtime configuration. It selects the design and chartpack, solve options, caching, results and reporting. Run it only after reviewing its client-configuration section:

python run_experiment.py

See running experiments for standard, optimisation, fixed-point and report-only run types.


This site uses Just the Docs, a documentation theme for Jekyll.