Model/domain/modelling/generators
Khalim Conn-Kowlessar 80d617aa5b modelling: glazing overlay models draught-proofing + frame-factor re-lodge
Fitting sealed glazing units changes two things beyond the pane's U/g
that the cascade reads, which the overlay didn't model — leaving the
double/secondary before→after pins ~0.7 SAP short (xfail):

1. Draught-proofing (RdSAP 10 §8.1). Sealed units draught-proof the panes
   they replace, re-lodging the dwelling-level `percent_draughtproofed`
   (cert 001431: 84 → 100). The §2 cascade reads that dwelling-level
   value, so the overlay now carries it. `_recompute_percent_draughtproofed`
   anchors on the lodged before-% — `after = round((round(before%/100 × N)
   + flips) / N × 100)`, N = openable windows (vertical + roof) + doors,
   flips = upgraded panes that were not draught-proofed — so it's robust
   to incomplete window extraction (unchanged openings are already in the
   aggregate). ~0.3 SAP.

2. Frame factor (§6 solar gains). A replacement unit re-lodges its own
   FF=0.70, overriding the pane it replaced — the two "single glazing,
   known data" panes lodge FF 1.00 / 0.50 (one is 6.6 m²), so leaving them
   unchanged understated solar gains by ~+150 kWh space heating. `WindowOverlay`
   now carries `frame_factor`, written flat onto the window. ~0.4 SAP.

Wiring: `EpcSimulation.percent_draughtproofed` + `WindowOverlay.frame_factor`
new fields; `apply_simulations` / `_fold_window` write them; the glazing
generator computes both from the upgraded set and cert 001431's after.

Un-xfails `test_{double,secondary}_glazing_overlay_reproduces_the_relodged_after`
— both now pin SAP/CO2/PE to the relodged after within tolerance. Updates
the two `test_glazing_recommendation` overlay expectations for the new
`frame_factor`. 96 modelling tests pass; zero new pyright errors.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 08:25:08 +00:00
..
__init__.py refactor(modelling): group domain/modelling into generators/scoring/optimisation 2026-06-03 13:48:36 +00:00
floor_recommendation.py refactor(modelling): type measure_type fields as MeasureType 2026-06-08 20:13:31 +00:00
glazing_recommendation.py modelling: glazing overlay models draught-proofing + frame-factor re-lodge 2026-06-24 08:25:08 +00:00
heating_recommendation.py measured excluded plus get geospatial nearby stuff working 2026-06-22 16:12:16 +00:00
lighting_recommendation.py feat(modelling): MeasureType StrEnum as the canonical measure vocabulary 2026-06-08 19:54:04 +00:00
roof_recommendation.py refactor(modelling): type measure_type fields as MeasureType 2026-06-08 20:13:31 +00:00
secondary_heating_recommendation.py feat(modelling): secondary-heating-removal generator + MeasureType (ADR-0028) 2026-06-11 13:35:14 +00:00
solar_recommendation.py feat(modelling): MeasureType StrEnum as the canonical measure vocabulary 2026-06-08 19:54:04 +00:00
solid_wall_recommendation.py refactor(modelling): type measure_type fields as MeasureType 2026-06-08 20:13:31 +00:00
ventilation_recommendation.py feat(modelling): MeasureType StrEnum as the canonical measure vocabulary 2026-06-08 19:54:04 +00:00
wall_recommendation.py feat(modelling): MeasureType StrEnum as the canonical measure vocabulary 2026-06-08 19:54:04 +00:00