mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
RdSAP10 `wall_construction == 6` is canonically WALL_SYSTEM_BUILT — a WALL TYPE — but the gov-EPC basement heuristic hijacked it: Elmhurst lodges both "SY System build" and "B Basement wall" as code 6, and the API lodges basements as code 6 too, so a system-built wall was mis-flagged `main_wall_is_basement` → wrong RdSAP §5.17 / Table 23 u_basement_wall/u_basement_floor overrides, and downstream the solid-wall Recommendation Generator couldn't offer EWI/IWI on system-built walls. System-built stays the wall type on its canonical code 6; the basement signal moves OFF code 6 to a dedicated `is_basement` (SapAlternativeWall) / `wall_is_basement` (SapBuildingPart) Optional[bool] flag: - Elmhurst: `_elmhurst_wall_is_basement` sets it from the distinct "SY"/"B" labels (False for SY, True for B, None otherwise). - gov-EPC API: per-wall code 6 can't be told apart at lodging time, so `from_api_response` post-processes via `_clear_basement_flag_when_ system_built` — when the cert addendum marks the dwelling system-built, the code-6 basement heuristic is cleared. A genuine basement (no addendum signal) keeps the code-6 fallback. - `main_wall_is_basement` / `is_basement_wall` honour the flag when set, else fall back to the code-6 heuristic — so untouched API basements and the cert 000565 "B" cohort are unchanged. `EpcPropertyData.system_build` is a derived property over the wall type: the MAIN wall is system-built iff `wall_construction == 6` and it is not flagged basement. System-built lives on `wall_construction`; the basement attribute is separate. Acceptance: a system-built main wall (Elmhurst SY, or API addendum system_build) → wall_construction == 6, main_wall_is_basement is False, system_build is True; a genuine basement main wall → main_wall_is_basement is True, system_build is False. Full §4 suite green (2404 passed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| epc | ||
| magicplan | ||
| __init__.py | ||
| datatypes.py | ||
| enums.py | ||