mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-12 13:29:04 +00:00
Slice 5 (local run sources the DB, read-only) + slice 6 (optional persist), landing together as one script rewrite (the persist path is interleaved with the compute path). The same local computation now runs whether or not the result is stored: - Both modes price against the live `material` catalogue (read-only ProductPostgresRepository over one shared Session) and model against a real Scenario read from the DB (--scenario-id; its goal_value drives the band, rejected if null) — so the inspected recommendations are exactly what gets stored. The JSON sample catalogue is no longer used by this script. - --measures restricts the run to a comma-separated considered_measures allowlist (e.g. high_heat_retention_storage_heaters,solar_pv). - --persist writes the inputs (EPC + spatial + solar) and the *same* computed Plan via the production repos in one PostgresUnitOfWork, then commits (idempotent: PlanPostgresRepository replaces by (property_id, scenario_id)). Gated: --persist requires --scenario-id and --portfolio-id. Default is inspect-only — no DB writes. harness.console.run_modelling gains `products` and `scenario` overrides (the seam the script drives); defaults unchanged, so existing callers are unaffected. Suite 257 pass + 3 xfail; pyright clean; --help/guard/measure parsing verified. Not yet executed against the DB (awaiting property_ids + write-confirm). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| cohort.py | ||
| console.py | ||
| epc_bulk.py | ||
| plan_table.py | ||
| report.py | ||
| sample_catalogue.json | ||