Model/datatypes
Khalim Conn-Kowlessar cdc7212d18 Slice S0380.96: RIR insulation "Unknown" thickness extractor + mapper (RdSAP 10 §3.10.1)
RdSAP 10 Specification §3.10.1 (PDF p.24) "Default U-values of the
roof rooms":

  "Where the details of insulation are not available, the default
   U-values are those for the appropriate age band for the
   construction of the roof rooms (see Table 18 : Assumed roof
   U-values when Table 16 or Table 17 do not apply). The default
   U-values apply when the roof room insulation is 'as built' or
   'unknown'."

Cert 000565 Summary §8.1 BP[4] Ext4 lodges:
  Flat Ceiling 1   5.00   1.00   Unknown   PUR or PIR   0.15   No
Worksheet line (30): `Roof room Ext4 Flat Ceiling 1: 5 × 0.15 =
0.75 W/K` (U985-0001-000565 line 333).

Pre-slice the extractor allow-list `_RIR_INSULATION_THICKNESS_RE
| ("As Built", "None")` did NOT include the "Unknown" thickness
token, so the cell was dropped (`insulation = ""`). The mapper
translated `""` to `insulation_thickness_mm=0`, and the cascade
hit Table 17 row 0 → U=2.30 vs worksheet 0.15 (over-counting
BP[4] FC1 by +10.75 W/K on a 5 m² ceiling).

Two-layer fix:

1. Extractor (`elmhurst_extractor.py:_parse_rir_surface_row`) — add
   "Unknown" as the third spec-valid thickness token alongside
   "As Built" and "None".
2. Mapper (`mapper.py:_elmhurst_rir_insulation_thickness_mm`) —
   return `Optional[int]`; "Unknown" → None. The cascade's existing
   `_u_rr_table_17` already falls back to `u_rr_default_all_elements`
   (Table 18 col 4) when thickness is None — for cert 000565 BP[4]
   age band M, returns 0.15 W/m²K ✓.

Cascade no-op: the existing None → Table 18 col 4 fallback IS the
spec-correct path per §3.10.1; no calculator changes needed.

Movement at HEAD (cert 000565):
- BP[4] FC1 cascade U: 2.30 → 0.15 ✓ EXACT vs ws 0.15
- roof_w_per_k: 63.72 → 52.97 (Δ +12.34 → +1.59, closed -10.75)
- sap_score_continuous: 28.07 → 28.31 (Δ -0.44 → -0.20)
- sap_score (int): 28 (continuous still below 28.5 threshold;
  remaining residual + BP[1] residual + BP[2] floor)
- SH: +533 → +218 kWh

Test count: 585 → 587 pass (+2 new AAA tests) + 9 expected 000565
fails unchanged.

Cohort safety: "Unknown" RIR insulation appears only in cert 000565
across the Summary fixture set (grep audit); cohort certs lodge
concrete thickness or "None"/"As Built". Pyright net-zero per
touched file.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 16:28:47 +00:00
..
epc Slice S0380.96: RIR insulation "Unknown" thickness extractor + mapper (RdSAP 10 §3.10.1) 2026-06-01 16:28:47 +00:00
magicplan typing and renaming 🟪 2026-05-07 13:26:49 +00:00
__init__.py further breaking up code 2023-07-20 12:24:34 +01:00
datatypes.py further breaking up code 2023-07-20 12:24:34 +01:00
enums.py completed build of new demo portfolio - some fixed required still 2023-11-20 14:42:16 +00:00