Model/tests/domain
Khalim Conn-Kowlessar 69fdbf9f1d S0380.223: complete _part_geometry early-return key contract (RR KeyError)
5 certs in a 2026 API sample raised `KeyError: 'rr_common_wall_area_m2'`
and were blocked from computing. Root cause: `_part_geometry`'s early
return (taken when a building part lodges no sap_floor_dimensions —
e.g. a party-wall-only or RR-only extension as bp[0]) returned only 6 of
the 9 keys the full return exposes, omitting rr_common_wall_area_m2,
rr_gable_area_m2 and cantilever_floor_area_m2. The §3.9 RR contribution
block reads geom["rr_common_wall_area_m2"] / ["rr_gable_area_m2"] for
EVERY part, so the floorless part's truncated dict raised KeyError at
heat_transmission.py:974.

Fix: the early return now exposes all 9 keys, the three RR/cantilever
geometry values defaulting to 0.0 — correct, since a part with no floor
dimensions has no derivable RR shell or cantilever (no floor area).
Pure contract-completion bug; no spec/U-value change.

Regression test pins the invariant directly: a floorless part's
_part_geometry keys must equal a with-floors part's keys. Validated: all
5 certs now compute (4 within ~2 SAP of lodged; the 5th, 8536, has a
separate residual). §4 suite 2393 passed; heat_transmission.py pyright
unchanged at 12, test file at 71.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 15:33:52 +00:00
..
addresses standardist Address 2026-05-22 10:13:32 +00:00
fuel_rates feat(fuel-rates): FuelRates snapshot + repository foundation (ADR-0014) 2026-06-02 09:29:07 +00:00
property feat(property): Property aggregate + PropertyRepository (#1132) 2026-05-30 19:39:54 +00:00
property_baseline Thread appliances + cooking annual kWh onto SapResult for ADR-0014 bills 2026-06-02 15:00:10 +00:00
sap10_calculator S0380.223: complete _part_geometry early-return key contract (RR KeyError) 2026-06-04 15:33:52 +00:00
tasks tests framework completed 2026-05-20 14:00:19 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
test_postcode.py tests framework completed 2026-05-20 14:00:19 +00:00