message_ix_models.tests.model.test_bmt
Tests for the BMT workflow (Buildings, Materials, Transport).
Covers message_ix_models.model.bmt.workflow and linked sector builds:
After
M reported,message_ix_models.model.transport.workflow.add_steps()uses the transport scenario code from BMT config (context.transport.code) to add MESSAGEix-Transport steps, including<transport code> T builtwithmessage_ix_models.model.transport.build.main();MT builtthen clones that branch and callsmessage_ix_models.model.bmt.workflow._set_as_default`().BMT built:message_ix_models.model.buildings.build.main().BMTX built:message_ix_models.model.bmt.utils.build_PM().
Coverage notes: - prepare_data_B and build_B: tested with and without materials
(with_materials=False and with_materials=True in test_prepare_data_B_*, test_build_B_runs_with_minimal_data, test_build_B_runs_with_materials).
utils: build_PM (test_build_PM_*), _generate_vetting_csv (test_generate_vetting_csv*).
CLI: bmt group and run subcommand (test_bmt_cli_help, test_bmt_run_dry_run).
Common workflow step functions: _set_as_default, prep_for_macro, add_macro.
Functions
|
BMT context (R12) and buildings config with paths to minimal CSVs. |
|
Like bmt_context but with with_materials=True for build_B materials path. |
|
|
|
bmt and bmt run show --help. |
|
bmt run --dry-run TARGET runs workflow in dry-run (writes SVG, no execution). |
The BMT workflow includes the 'BMTX built' step that calls build_PM. |
|
The BMT workflow includes MT built and BMT built steps. |
|
|
build_PM(context, scenario) runs; skip if scenario lacks inv_cost. |
|
build_PM returns the scenario when power-sector material data already exists. |
|
generate_vetting_csv writes CSV of original/modified demand and subtraction. |
|
generate_vetting_csv handles zeros in original_demand. |
|
prep_for_macro removes macro sectors and calls solve. |
|
_set_as_default sets the scenario as default and returns it. |