Model/backend/documents_parser/tests
Khalim Conn-Kowlessar b7f127caec Fix six PasHub from_site_notes extractor/mapper defects (#1649)
All six are `from_site_notes`-only (gov-API RdSAP corpus unmoved at 78.9%),
graded against the DB PasHub-assessment oracle (energy_rating_current,
source='lodged'), not the surveyor-entered pre_sap.

A. Manual-Entry boiler efficiency. Extractor read PCDF-Search columns that a
   manual survey lacks; mapper returned None for all boilers → the generic
   0.80 gas default. Now read `Type of boiler:` / `Heating System (Boiler):`
   / `Is there an open flue?` and resolve the descriptor to its SAP 10.2
   Table 4b code. Moves all 7 Wythenshawe manual boilers to the oracle
   (4a Hollyhedge back boiler 63.6→53.4=53; group MAE 2.42→0.42).

B. Room-in-roof gable type None → strict-raise. A form variant omits the
   gable-type line (genuine field-absence); default None → party `gable_wall`
   (U=0.25), mirroring `_api_type_1_gable_kind(None)`. Present-but-unknown
   labels still strict-raise. Unblocks 8 & 34 Bucklow Drive.

C. Secondary `Closed room heater` unmapped → add Table 4a code 633.
   Unblocks 8 Brinkshaw Avenue.

D. Alternative-wall insulation thickness never extracted → parse
   `Wall insulation thickness:` and pass it through instead of the RdSAP 10
   §5.4 100 mm favourable default.

E. `Number of heated rooms?` label mismatch → the PDF lodges
   `Please enter the number of HEATED rooms:`.

F. HW cylinder thermostat dropped (NEW, systematic). `_map_sap_heating`
   never set `cylinder_thermostat`, so a surveyed thermostat defaulted None
   and the calculator applied the SAP 10.2 Table 2b Note a) ×1.3 penalty.
   Map it ("Y"/"N", gated on a lodged cylinder) as the Elmhurst path does.
   Fixes the two worst DB-oracle under-raters (52 Bucklow 59.4→61.8=62;
   13 Kerne Grove 65.0→67.1=67).

DB-oracle cohort (148 matched): within-0.5 83.8%→87.8%, MAE 0.427→0.303.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 11:30:00 +00:00
..
fixtures PasHub SAP accuracy: pin Wythenshawe cohort (149/168 computable) 🟩 2026-07-16 14:49:17 +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 rename mains_gas to gas_connection_available 2026-07-01 10:50:58 +00:00
test_elmhurst_extractor.py fix(extractor): drop windows-table header remnant from first window glazing type 2026-06-02 22:54:49 +00:00
test_end_to_end.py PasHub SAP accuracy: infiltration inputs + immersion DHW + lights/lobby/heat-network (#1615) 2026-07-16 00:30:55 +01:00
test_extractor.py Fix six PasHub from_site_notes extractor/mapper defects (#1649) 2026-07-19 11:30:00 +00:00
test_heating_systems_corpus.py Merge remote-tracking branch 'origin/main' into feature/per-cert-mapper-validation 2026-06-13 22:20:15 +00:00
test_pashub_sap_accuracy.py PasHub SAP accuracy: refresh 5 Paxton fixture to the current V5 (MEV) re-survey 🟩 2026-07-16 00:52:33 +00:00
test_pashub_sap_accuracy_lrha_wave3.py Document LRHA WAVE 3 end-state coverage and residual blocks 🟩 2026-07-16 16:41:32 +00:00
test_pashub_sap_accuracy_wythenshawe.py Rate gas room-heater main systems at Table 4a code 603 🟩 2026-07-16 16:41:32 +00:00
test_pdf.py rename example site notes to PasHub_ and add Elmhurst example 2026-04-24 13:01:51 +00:00
test_room_heater_worksheet_001431.py S0380.239: system-build walls take masonry structural infiltration (0.35) 2026-06-05 19:00:02 +00:00
test_summary_pdf_mapper_chain.py fix(roof): bill at-rafters insulation on RdSAP 10 Table 16/18 column (2) 2026-06-16 04:42:44 +00:00