Model/datatypes
Khalim Conn-Kowlessar ad3f9dcb3d Slice S0380.111: roof-window inclination adj via Table 6e Note 2 (SAP 10.2 p.180)
SAP 10.2 §3.2 "Roof windows" (PDF p.10) verbatim:

  "In the case of roof windows, unless the measurement or calculation
  has been done for the actual inclination of the roof window,
  adjustments as given in Notes 1 and 2 to Table 6e or from BR443
  (2019) should be applied."

SAP 10.2 Table 6e Note 2 (PDF p.180) — "For roof windows the
following adjustments should be applied to convert a known vertical
U-value into the U-value for the known inclined position":

   Inclination                    Twin skin or DG    Triple skin or TG
   70° or more (vertical)               +0.0              +0.0
   < 70° and > 60°                      +0.2              +0.1
   60° and > 40°                        +0.3              +0.2
   40° and > 30°                        +0.4              +0.2
   30° or less (horizontal)             +0.5              +0.3

SAP 10.2 §3.2 formula (2):

    U_w,effective = 1 / (1/U_w + 0.04)                          (2)

The +0.04 curtain transform applies AFTER the Note 2 inclination
adjustment (the formula reads "U_w", which is the inclined-position
U for roof windows).

Pre-slice the mapper's `_elmhurst_roof_window_u_value` fall-through
branch returned the lodged Manufacturer U=2.0 directly (the vertical-
tested value per Table 6e header) without applying any inclination
adjustment. The cascade then applied formula (2) → U_eff = 1/(1/2.0 +
0.04) = 1.852 for both cert 000565 rooflights, totalling 1.7 × 1.852
= 3.1484 W/K vs the worksheet's (27a) Σ A × 2.1062 = 3.5806 W/K
(residual -0.43 W/K).

Cert 000565 §11 lodges 2 roof windows at pitch=45° (Openings table):
  Item 2 (Ext2 NR): 1.2 m², "Triple between 2002 and 2021",
    Manufacturer U=2.0, g=0.72, PVC FF=0.70
  Item 5 (Ext4 A):  0.5 m², "Double between 2002 and 2021",
    Manufacturer U=2.0, g=0.72, Wood FF=0.70

Both lodge at pitch=45° → Note 2 "60° and > 40°" row. The worksheet
applies +0.30 W/m²K uniformly to both (DG-column value), yielding
U_inclined = 2.30 → formula (2) → U_eff = 2.1062 in both cases.
Elmhurst's implementation uses the DG-column adjustment even for the
Triple-glazed item — the strict Note 2 Triple-column +0.20
alternative would yield 2.0222 for Item 2, contradicting the
worksheet's 2.1062.

Fix scope (mapper-side, single helper):

`datatypes/epc/domain/mapper.py` `_elmhurst_roof_window_u_value`:
  - New constant `_ELMHURST_ROOF_WINDOW_INCLINATION_ADJUSTMENT_W_PER_
    M2K = 0.30` (Table 6e Note 2 DG @ 40-60°).
  - Fall-through branch now returns `w.u_value + 0.30` instead of
    `w.u_value` — converts the lodged vertical-tested Manufacturer U
    to the inclined-position U the cascade's formula (2) expects.
  - Lookup path (`_ELMHURST_ROOF_WINDOW_U_BY_GLAZING["Double pre 2002"]
    = 3.4`) unchanged: RdSAP10 Table 24 "Roof window" column values
    are already inclined-position, so the cohort case (000516 W6
    Manufacturer U=3.10 → Table 24 returns 3.40 → cascade formula
    (2) → 2.9930) stays bit-exact.

Cohort safety verified at 000516 worksheet (27a): U_eff = 2.9930
preserved (Table 24 lookup path unaffected).

Cert 000565 cascade snapshot (HEAD 9461e657 → this):
  roof_windows_w_per_k    3.1484  → 3.5806  ✓ EXACT (Δ -0.43 → +0.0001)
  total_w_per_k           937.09  → 937.51  (Δ +0.03 → +0.45 — closing
                                              roof_windows exposes
                                              previously-cancelling
                                              roof +0.30 + TB +0.15
                                              over-counts)
  sap_score (int)             29 → 28 (transiently — continuous
                                       crossed 28.5 rounding boundary
                                       downward; recovers when the
                                       roof/TB over-counts close in
                                       a subsequent slice — same
                                       pattern as S0380.107 → .108)
  sap_score_continuous   28.5002 → 28.4903 (Δ -0.0085 → -0.0184)
  ecf                     5.3877 → 5.3887   (Δ +0.0011 → +0.0021)
  total_fuel_cost_gbp    4681.01 → 4681.89  (+0.75 → +1.63)
  co2_kg_per_yr          6448.59 → 6449.73  (+0.96 → +2.10)
  space_heating_kwh     59019.18 → 59031.86 (+10.83 → +23.51)
  main_heating_fuel     34717.16 → 34724.63 (+6.37  → +13.83)
  lighting_kwh_per_yr         ✓ EXACT (preserved)

This is the [[feedback-spec-floor-skepticism]] pattern: a spec-correct
closure exposes previously-cancelling residuals elsewhere. Continuous
SAP magnitude widens (0.0085 → 0.0184) and integer SAP sign-flips
across the 28.5 boundary, but the spec-correct path is now in place.
The next slice would close the roof (+0.30) or TB (+0.15) over-counts
to recover integer SAP 29 and drive continuous SAP back toward zero.

Pyright net-zero (45 → 45 errors across touched files).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-01 16:28:47 +00:00
..
epc Slice S0380.111: roof-window inclination adj via Table 6e Note 2 (SAP 10.2 p.180) 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