Skip to content

Commit ea1e49a

Browse files
committed
Implement materialize_mixed_upgrade: per-year ResStock data for HP adoption
Assigns baseline buildings to upgrades using a monotonic random-seed allocation (contiguous shuffled-rank bands, one per upgrade), then writes per-year materialized data that run_scenario.py can consume unchanged: - metadata-sb.parquet: rows from each upgrade's metadata filtered to the buildings assigned to it for that year, combined into one file. - loads/: symlinks pointing each building to the correct upgrade's load parquet ({bldg_id}-{N}.parquet), discovered from the source directory rather than hard-coding a filename format. Buildings with postprocess_group.has_hp == True in the upgrade-0 baseline are excluded from random assignment and pinned to upgrade 0 in every year (they already have a heat pump and should not be re-assigned to a new HP upgrade). Also writes scenario_assignments.csv for reference (bldg_id + one column per run year showing the assigned upgrade). Validates the adoption config with buildstock_fetch.scenarios.validate_scenario before any I/O; errors clearly if required upgrade directories are missing.
1 parent ddf458d commit ea1e49a

1 file changed

Lines changed: 385 additions & 17 deletions

File tree

0 commit comments

Comments
 (0)