Model/tests/orchestration
Jun-te Kim 6679d8c621 Fall back to computed kWh for predicted-EPC baselines (no lodged RHI)
16 modelling_e2e properties failed with "Effective EPC is missing
renewable_heat_incentive; cannot read baseline space-heating / hot-water kWh".

Baseline runs for predicted properties too (ADR-0031), reading space/water-
heating kWh off the EPC's lodged RHI block. Predicted EPCs deep-copy a neighbour
template that may carry no RHI, so `_require_rhi` hard-failed the whole subtask.

Fix: when the EPC has no RHI, fall back to the property's OWN computed figures
from the scored SapResult (space_heating_kwh_per_yr / hot_water_kwh_per_yr) —
more representative than a neighbour's lodged numbers. Only when there is also no
SapResult (the rebaseliner scored nothing) is there genuinely no demand to
record, and we still fail noisily. Lodged certs are unchanged (RHI still wins).

Regression tests: fallback-to-computed, and the no-RHI/no-result raise.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 08:58:24 +00:00
..
audit_generator move spreadsheet population logic to domain 2026-06-09 14:43:24 +00:00
magic_plan UploadedFile, FileTypeEnum, FileSourceEnum importable from infrastructure.postgres.uploaded_file_table 🟩 2026-06-09 11:50:51 +00:00
__init__.py added postcode splitter rewrite to ddd 2026-05-19 16:35:09 +00:00
fakes.py feat(modelling): mark a Property as run via has_recommendations + updated_at 2026-06-16 23:34:33 +00:00
test_ara_first_run_pipeline.py feat(modelling): ModellingOrchestrator persists a Plan end-to-end (#1157) 2026-06-03 12:08:32 +00:00
test_ara_first_run_pipeline_integration.py feat(modelling): price secondary-heating-removal from an off-catalogue overlay 2026-06-19 14:49:51 +00:00
test_build_canonical_filename.py move tests out of scripts/ 2026-06-15 11:11:08 +00:00
test_bulk_upload_finaliser_orchestrator.py feat(modelling): mark a Property as run via has_recommendations + updated_at 2026-06-16 23:34:33 +00:00
test_first_run_without_database.py feat(modelling): run_one console entrypoint for DB-less inspection 2026-06-04 08:14:14 +00:00
test_ingestion_orchestrator.py 17.1 and 18 done by claude 2026-06-12 12:52:36 +00:00
test_ingestion_prediction.py refactor(epc-prediction): PR review — rename ComparableProperty, relocate PredictionTarget 2026-06-16 13:34:44 +00:00
test_landlord_description_overrides_orchestrator.py Group landlord property-override enums under domain/epc/property_overrides 🟪 2026-06-19 14:49:58 +00:00
test_modelling_solar_threading.py feat(modelling): gate generation by the considered-measures allowlist 2026-06-16 14:56:09 +00:00
test_postcode_splitter_orchestrator.py updated rdsap option; seperated s3 location in infrastrucutre; added open ai api 2026-05-22 14:00:33 +00:00
test_property_baseline_orchestrator.py Fall back to computed kWh for predicted-EPC baselines (no lodged RHI) 2026-06-24 08:58:24 +00:00
test_task_orchestrator.py tests framework completed 2026-05-20 14:00:19 +00:00