Model/backend/documents_parser/tests
Khalim Conn-Kowlessar d4d0aa2495 Slice S0380.5: surface insulated_door_u_value from Summary §10 'Average U-value'
Closes the three-layer gap that left the Summary mapper producing
`insulated_door_u_value=None` even though Summary §10 lodges
"Average U-value" / "1.20" explicitly on cert 0380:

1. `datatypes/epc/surveys/elmhurst_site_notes.py` — add
   `ElmhurstSiteNotes.insulated_door_u_value: Optional[float] = None`,
   placed in the defaulted-field block so existing fixtures that
   omit the field still construct without changes.
2. `backend/documents_parser/elmhurst_extractor.py` — add
   `_extract_door_u_value` that section-scopes the lookup to
   `_section_lines("10.0 Doors:", "11.0 Windows:")` so the bare
   "Average U-value" label cannot be shadowed by global U-value
   lookups in §7 Walls / §8 Roofs / §9 Floors.
3. `datatypes/epc/domain/mapper.py` — surface
   `insulated_door_u_value=survey.insulated_door_u_value` on the
   `from_elmhurst_site_notes` path. The comment in
   `epc_property_data.py:585` ("Not available in site notes") is now
   outdated for Elmhurst Summary PDFs that lodge the explicit value.

Worksheet anchor (dr87-0001-000899.pdf line ref (26)):

  Doors insulated 1   NetArea 3.7000   U-value 1.2000   A×U 4.4400 W/K

Forcing function (Slice S0380.1): cert 0380 Summary cascade
`doors_w_per_k` moves from 5.1800 to **4.4400 W/K — exact match
against worksheet line ref (26)**. The +0.74 W/K mis-attribution
was the default door-U fall-through that the lodged 1.20 value
silences. SAP moves 88.1981 (Δ -0.3123) → 88.2746 (Δ -0.2358).

Added focused unit test
`test_summary_0380_surfaces_insulated_door_u_value_1_2` that pins
the mapper boundary directly to the worksheet's lodged U-value 1.2,
so future debuggers can localise regressions in the new extractor /
field / mapper path before walking the full chain.

Pyright net-zero across all four edited files:
  datatypes/epc/domain/mapper.py:                32 (baseline)
  datatypes/epc/surveys/elmhurst_site_notes.py:   0
  backend/documents_parser/elmhurst_extractor.py: 0
  backend/documents_parser/tests/test_summary_pdf_mapper_chain.py: 0

Regression suite: 673 pass + 11 fail (vs handover baseline 669 + 10
— net +4 pass for the four GREEN unit tests across Slices S0380.2-5;
the +1 fail vs baseline is the S0380.1 chain test which this slice
moves to Δ -0.2358 but does not yet fully close).

Spec refs:
- SAP 10.2 Table 14 (door U-values: composite-construction default
  cascade is silenced when the assessor lodges an explicit measured
  U on the cert; routed via `insulated_door_u_value`).
- Cert 0380 worksheet dr87-0001-000899.pdf line ref (26) — the
  A×U=4.4400 W/K spec value that this slice closes the Summary
  cascade to exactly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 18:28:42 +00:00
..
fixtures chore: stage cert 9501 fixtures (second boiler validation cert) 2026-05-26 18:53:08 +00:00
__init__.py Map to RdSapSiteNotes from site notes JSON 🟥 2026-04-16 13:54:03 +00:00
test_elmhurst_end_to_end.py fix: address 22 project-wide test failures from previous sweep 2026-05-26 13:34:51 +00:00
test_elmhurst_extractor.py extract window frame details from elmhurst site notes 🟥 2026-04-27 15:50:25 +00:00
test_end_to_end.py P6.1 follow-on: unbox BuildingPartIdentifier at backend boundaries 2026-05-20 09:58:23 +00:00
test_extractor.py Handle wall thickness "Unmeasurable" 🟩 2026-04-30 16:41:16 +00:00
test_pdf.py rename example site notes to PasHub_ and add Elmhurst example 2026-04-24 13:01:51 +00:00
test_summary_pdf_mapper_chain.py Slice S0380.5: surface insulated_door_u_value from Summary §10 'Average U-value' 2026-05-27 18:28:42 +00:00