message_ix_models.model.bmt.config.apply_bmt_config

message_ix_models.model.bmt.config.apply_bmt_config(context: Context, path: Path | None = None) None[source]

Load BMT configuration file into context (bmt, buildings, macro, transport).

The file given by path must be in YAML format and have the top-level keys:

model_name: "..."
buildings:
   # ...
macro: "..."
materials:  # Optional
   # ...
transport:  # Optional
   # ...

All data from the file is stored at the key context.bmt as a dict. The function then sets or converts other values:

  • context.buildings: an instance of Config (including Config.data_paths, :attr`~code`` for STURM, etc.) from the buildings mapping.

  • context.macro: macro string (macro calibration workbook).

  • context.transport: and instance of transport.config.Config using from_context(), with the YAML transport mapping passed as options (e.g. code: "M SSP2").

    Note

    The context.transport key must be an instance of that class, because model.transport code expects its various attributes.

Parameters:

path – Configuration file path. If not given, defaults to data/bmt/config.yaml. This file must be in YAML format has top-leve