Model/backend/documents_parser
Khalim Conn-Kowlessar 09fb6f1b73 fix: address 22 project-wide test failures from previous sweep
Three orthogonal issues surfaced by the full project test sweep:

1. Dockerfile.test: install poppler-utils alongside postgresql.
   The 20× `pdfinfo: No such file or directory` failures in
   test_summary_pdf_mapper_chain.py traced to the CI test image
   missing the poppler-utils system package (pdfinfo + pdftotext).
   `_summary_pdf_to_textract_style_pages` shells out to these for
   layout-preserving PDF text extraction. Pure-Python alternatives
   (pymupdf, pypdf) don't reproduce pdftotext -layout's row-major
   table cell ordering, which the Elmhurst Summary extractor depends
   on. So system poppler is the right fix; added to apt-get install
   with an explanatory comment.

2. test_from_rdsap_schema.py::test_total_floor_area: expected 55.0,
   got 45.82. Slice 95 (commit f502db8c) changed the API mapper to
   compute total_floor_area_m2 from the precise sum of per-bp
   sap_floor_dimensions[*].total_floor_area rather than the lodged
   scalar. The synthetic 21_0_1.json fixture has lodged total_floor_
   area=55 + a single fd of 45.82 (per-bp sum doesn't match lodged).
   Updated the expected to 45.82 with a comment explaining the
   Slice 95 per-bp-sum precedence.

3. test_elmhurst_end_to_end.py::test_emitter_temperature: expected
   "Unknown", got int 1. Pre-existing failure (confirmed by checking
   out commit 985a59e1 and reproducing). `_elmhurst_emitter_
   temperature_int` in datatypes/epc/domain/mapper.py converts the
   Elmhurst Summary §14 "Design flow temperature: Unknown" to SAP10.2
   Table 4d code 1 (high-temp / ≥45 °C, worst-case for unmeasured
   boilers). The int encoding mirrors the API mapper's MainHeating
   Detail.emitter_temperature for cross-mapper field parity. Test
   updated to expect 1 (with comment) since the conversion is the
   correct production behaviour.

Verified:
- Layer 4 1e-4 gate (test_api_001479_full_chain_sap_matches_worksheet_
  pdf_exactly) still GREEN.
- Wider domain sweep (domain/sap10_calculator + domain/sap10_ml):
  1654 passed / 20 failed, exact pre-fix baseline.
- All three originally-failing tests now PASS.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 13:34:51 +00:00
..
handler address JTK review comments 2026-04-20 15:11:17 +00:00
tests fix: address 22 project-wide test failures from previous sweep 2026-05-26 13:34:51 +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 53: Summary_000487 chain pins SAP at 1e-4 — last cohort cert closed 2026-05-24 21:42:42 +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