Model/backend/documents_parser
Khalim Conn-Kowlessar 0735c7e81c Slice 99e: PV pitch enum-not-degrees + cert 9501 Layer 2 chain test
`EpcPropertyData.PhotovoltaicArray.pitch` is the RdSAP 10 §11.1
integer code (1=0°, 2=30°, 3=45°, 4=60°, 5=90°) — NOT degrees. The
cascade's `cert_to_inputs._PV_PITCH_DEG_BY_CODE` reads the code, not
the value. Slice 99d's mapper passed the raw degrees (45) directly,
which fell through to the default 30° lookup (Appendix U3.3 S(SW,
30°) ≈ 1029 kWh/m²/yr vs S(SW, 45°) ≈ 1004 — 2.5% over-credit on
the PV generation, manifesting as -£6.27 over-credit on total cost
→ +0.23 SAP delta).

Added `_elmhurst_pv_pitch_code` helper that maps the lodged degrees
to the nearest tabulated code (snap-to-nearest fallback for non-
tabulated tilts; defaults to code 2 / 30° per the cascade's own
`_PV_PITCH_DEG_DEFAULT`).

Effect on cert 9501 Summary path:
- pv_export_credit £256.30 → £250.02 (= worksheet 250.02 exact)
- total_fuel_cost £842.94 → £849.21 (= worksheet 849.21 exact)
- sap_continuous 68.7577 → **68.5252** (= worksheet 68.5252 exact;
  Δ -0.0000 at 1e-4)

`test_summary_9501_full_chain_sap_matches_worksheet_pdf_exactly`
added — the second flat-shaped cert pinned to worksheet SAP at 1e-4
after the cert 0330 / 001479 boiler-house chain tests. Third boiler
validation cert closed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 21:45:07 +00:00
..
handler address JTK review comments 2026-04-20 15:11:17 +00:00
tests Slice 99e: PV pitch enum-not-degrees + cert 9501 Layer 2 chain test 2026-05-26 21:45:07 +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 99d: surface PV array from Elmhurst Summary §19.0 2026-05-26 21:38:14 +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