Model/backend/documents_parser
Khalim Conn-Kowlessar b1478cff63 Slice S0380.145: Table 4e temperature adjustment — apply (92)m → (93)m offset per Table 9c step 8
SAP 10.2 Table 4e (PDF p.170-173) "Heating system controls":

  3. The 'Temperature adjustment' modifies the mean internal
     temperature and is added to worksheet (92)m.

SAP 10.2 Table 9c step 8 (PDF p.184): "Apply adjustment to the mean
internal temperature from Table 4e, where appropriate".

Pre-slice the cascade hardcoded `control_temperature_adjustment_c
=0.0` at all three call sites of `mean_internal_temperature_monthly`
and `space_heating_section_with_results`. The §8 heat loss calc
therefore drove off (92)m unchanged → §8 SH demand under-counted on
every cert whose `main_heating_control` lodges a non-zero adjustment.

Table 4e adjustments by code (full p.170-173 coverage):

  Group 0 — No heating system:
    2699: +0.3
  Group 1 — Boilers with radiators/UFH (+ micro-CHP):
    2101, 2102: +0.6   (no thermo / programmer-only)
    2103..2113: 0
  Group 2 — Heat pumps:
    2201, 2202: +0.3
    2203..2210: 0
  Group 3 — Heat networks:
    2301, 2302: +0.3
    2303..2314: 0
  Group 4 — Electric storage:
    2401 (Manual charge):                  +0.7
    2402 (Automatic charge):               +0.4
    2403 (Celect):                         +0.4
    2404 (HHR controls):                    0
  Group 5 — Warm air:
    2501, 2502: +0.3
    2503..2506: 0
  Group 6 — Room heaters:
    2601: +0.3
    2602..2605: 0
  Group 7 — Other systems:
    2701, 2702: +0.3
    2703..2706: 0

New `_control_temperature_adjustment_c(main)` helper consults
`_CONTROL_TEMPERATURE_ADJUSTMENT_BY_CODE` (52 entries, full Table 4e
coverage). Strict-raises `UnmappedSapCode` on present-but-unmapped
codes per [[reference-unmapped-sap-code]] so spec-coverage gaps
surface at test time. The helper is wired to all three call sites
of the MIT/SH orchestrators in cert_to_inputs.

Corpus impact — closes the +2.5 SAP cluster substantially:

  Variant | control |  pre  →  post  | delta
  ------- | ------- | -------------- | -----
  e3 (401)|  2401   | +2.55 → -0.09  | -2.46  (massive close)
  e6 (404)|  2402   | +1.33 → -0.17  | -1.50
  e7 (408)|  2402   | +1.29 → -0.20  | -1.49
  e2 (524)|  2502   | +0.47 → -0.18  | -0.65
  e5 (402)|  2402   | +0.07 → -1.43  | -1.50  (regressed —
                                              previously net-zero
                                              from offsetting bugs)

Cumulative |ΔSAP| across these 5: 5.71 → 2.07 (-3.64 pts closed).
electric 3 / 6 / 7 / 8 / 9 now all within 0.20 SAP of worksheet.
Golden fixtures unchanged (API certs in those tests don't lodge
non-zero-adjustment control codes; suite stays 888 pass).

Extended handover suite: 888 pass, 0 fail (was 887 + 1 new AAA test).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 21:50:10 +00:00
..
handler address JTK review comments 2026-04-20 15:11:17 +00:00
tests Slice S0380.145: Table 4e temperature adjustment — apply (92)m → (93)m offset per Table 9c step 8 2026-05-31 21:50:10 +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