diff --git a/scripts/run_modelling_e2e.py b/scripts/run_modelling_e2e.py index 00628860..a9e39fa6 100644 --- a/scripts/run_modelling_e2e.py +++ b/scripts/run_modelling_e2e.py @@ -14,10 +14,19 @@ persists **nothing** (the run is for inspecting recommendations); pass To keep the inspected recommendations identical to what gets stored, **both modes price against the live ``material`` catalogue (read-only)** and model against a real **Scenario** read from the DB — not the JSON sample catalogue. -Pass `--scenario-id` to target a real Scenario (its ``goal_value`` drives the -band); without it the run synthesises an Increasing-EPC-to-``--goal`` Scenario. -``--measures`` restricts the run to a comma-separated set of measure types -(mirroring the legacy `inclusions`) — e.g. only HHRSH + Solar PV. +Pass `--scenario-id` to target a real Scenario; its ``goal_value`` drives the +band and **its ``exclusions`` drive which measures the run considers** (the live +scenario table persists exclusions only, no inclusions). Without `--scenario-id` +the run synthesises an Increasing-EPC-to-``--goal`` Scenario with no exclusions. +`--measures` / `--exclude-measures` are optional overlays layered on top of the +Scenario's own exclusions. + +KNOWN GOTCHA: the live ``material.type`` enum does not yet carry +``secondary_heating_removal``, so a Property with a lodged secondary heater +crashes the catalogue read for that measure. Until the catalogue stocks it, pass +``--exclude-measures secondary_heating_removal`` (an ASHP row is also absent, but +ASHP is priced off the rate sheet so it degrades to ``material_id=None`` rather +than crashing — no flag needed). Config: loads `backend/.env` for the DB creds (`DB_*`), the EPC API token (`OPEN_EPC_API_TOKEN` — the Bearer token for the new gov API), the Google Solar @@ -25,13 +34,13 @@ key (`GOOGLE_SOLAR_API_KEY`) and the S3 reference bucket (`DATA_BUCKET`) — the agent never sees the secrets. AWS creds come from the ambient `~/.aws` profile. Run from the worktree root: - # inspect only (no DB writes), HHRSH + Solar PV, against Scenario 1263: - python -m scripts.run_modelling_e2e --scenario-id 1263 \ - --measures high_heat_retention_storage_heaters,solar_pv 115 116 117 - # same run, but persist the Plans (needs --portfolio-id): - python -m scripts.run_modelling_e2e --scenario-id 1263 --portfolio-id 4 \ - --measures high_heat_retention_storage_heaters,solar_pv --persist 115 116 117 - python -m scripts.run_modelling_e2e --no-solar 115 116 # skip the Google leg + # inspect only (no DB writes), Scenario 1266, measures from the Scenario: + python -m scripts.run_modelling_e2e --scenario-id 1266 \ + --exclude-measures secondary_heating_removal 709634 709635 709636 + # same run, but persist EPC + spatial + solar + Plan (needs --portfolio-id): + python -m scripts.run_modelling_e2e --scenario-id 1266 --portfolio-id 785 \ + --persist --exclude-measures secondary_heating_removal 709634 709635 + python -m scripts.run_modelling_e2e --no-solar 709634 709635 # skip Google leg Per Property the spatial reference (S3 Open-UPRN parquet) gives the planning protections (conservation/listed/heritage — gate the wall + solar measures) and