Model/backend/documents_parser
Khalim Conn-Kowlessar 7f9074fca9 Slice S0380.142: §4 (61)m/(59)m cascade — cylinder presence gates combi=0 + primary loss applies for PCDB Table 322 boilers
SAP 10.2 §4 line 7702 (PDF p.137):

  Combi loss for each month from Table 3a, 3b or 3c (enter '0' if
  not a combi boiler)

SAP 10.2 Table 3 (PDF p.160) zero-loss list for primary circuit loss:

  Electric immersion heater
  Combi boiler (including when it is part of a combined heat pump and
  boiler package and provides all the hot water)
  CPSU (including electric CPSU)
  Boiler and thermal store within a single casing
  Separate boiler and thermal store connected by no more than 1.5 m
  of insulated pipework
  Direct-acting electric boiler
  Heat pump (...) with hot water vessel integral to package

Combi boilers are defined by Table 3's zero-loss list entry: they
provide instantaneous DHW with no storage vessel. A cert that lodges
a hot-water cylinder therefore has a non-combi heat generator —
the cylinder bypasses any instantaneous-DHW capability and the
boiler acts as a regular boiler for the DHW circuit.

Two compounding gaps for PCDB Table 322 (gas/oil boiler) records
with a lodged cylinder:

(a) (61)m combi loss: pre-slice the cascade routed every PCDB record
    through `pcdb_combi_loss_override` regardless of cylinder
    presence. For PCDB regular boilers (subsidiary_type=0, store_
    type=0, separate_dhw_tests=0) this dispatched to Table 3a row 1
    "Instantaneous without keep-hot" — 600 kWh/yr. Cert pcdb 1
    (Potterton KOA PCDB 716 + 110 L cylinder) exposed this: worksheet
    (61)m = 0 ; cascade was lodging 600 kWh/yr keep-hot loss on a
    regular oil boiler.

(b) (59)m primary loss: `_primary_loss_applies` gated on
    `main_heating_category in {1, 2}`. The Elmhurst path leaves
    `main_heating_category=None`, so the gate returned False even
    when the cert lodged a PCDB Table 322 (gas/oil boiler) record +
    a cylinder. Worksheet (59)m sum ~1177 kWh ; cascade was zero.

Fix:

- `_water_heating_worksheet_and_gains` now zeroes combi_loss_override
  whenever `epc.has_hot_water_cylinder` is True (top-level gate
  preceding the `pcdb_combi_loss_override` dispatch). Preserves the
  existing non-cylinder fallback for HP / no-PCDB / community-heat
  certs that lack a main_heating_category lodgement.

- `_primary_loss_applies` extends the Elmhurst-path fallback: when
  `main_heating_index_number` resolves to a PCDB Table 322 record,
  return True (the cert is implicitly a boiler — Table 3 row 1 covers
  any "heat generator (e.g. boiler) connected to a hot water storage
  vessel via insulated or uninsulated pipes").

Corpus impact:

- pcdb 1 (Potterton KOA + cylinder, the only PCDB Table 322 + cylinder
  combination in the corpus): SAP +3.40 → +2.86; cost -£75.68 →
  -£63.22; CO2 -397.02 → -328.74; PE -1601.74 → -1257.97.

- Golden cert 0390-2954-3640-2196-4175 (Firebird oil combi PCDF 9005
  + cylinder): PE -26.37 → -28.50; CO2 -2.55 → -2.75. Combi-loss
  removal (-600 kWh/yr) exceeded the primary-loss gain (~5-10 kWh
  given the cert's insulated pipework + thermostat lodging), so the
  net (62) shifted down. Direction is more spec-correct: the spec
  treats a combi feeding a cylinder as a regular boiler for DHW,
  matching the (61)m=0 + (59)m>0 worksheet behaviour.

Extended handover suite: 885 pass, 0 fail.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 20:53:19 +00:00
..
handler address JTK review comments 2026-04-20 15:11:17 +00:00
tests Slice S0380.142: §4 (61)m/(59)m cascade — cylinder presence gates combi=0 + primary loss applies for PCDB Table 322 boilers 2026-05-31 20:53:19 +00:00
__init__.py Map to RdSapSiteNotes from site notes JSON 🟥 2026-04-16 13:54:03 +00:00
db_writer.py include updating epc_property_data to pashub to ara workflow 2026-04-29 09:55:14 +00:00
elmhurst_extractor.py Slice S0380.140: §4 cylinder storage loss — extractor picks up §16 thermostat lodging + Table 2b note b restricts ×0.9 to boiler/warm-air/HP systems 2026-05-31 19:03:58 +00:00
extractor.py Handle wall thickness "Unmeasurable" 🟩 2026-04-30 16:41:16 +00:00
local_runner.py update local runner to work for elmhurst 2026-04-24 14:01:36 +00:00
parser.py load ecmk site notes to db 2026-04-29 11:20:47 +00:00
pdf.py update local runner to work for elmhurst 2026-04-24 14:01:36 +00:00