mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
User-driven pivot from cascade chain-pin chase to the rigorous cohort
pattern: a hand-built EpcPropertyData that cascades to the worksheet
at 1e-4 is the ground truth for cross-mapper parity testing. Both the
Elmhurst mapper and the API mapper should ultimately produce a hand-
built-equivalent EpcPropertyData for cert 001479; every divergence
from the hand-built is a mapper bug.
This skeleton encodes the cert 001479 worksheet inputs:
- 3 building parts (Main C, Ext1 L, Ext2 C) with per-bp wall U
- Main party wall CU (cavity unfilled, U=0.50, lodged via WC_CAVITY=4)
- Cantilevered upper-storey Ext2 with `is_exposed_floor=True` (U=1.20)
- Ext2 PS sloping-ceiling roof at `roof_insulation_thickness=0`
(Slice 57 PS+pre-1950 path → Table 16 row 0 U=2.30)
- Main 300 mm joist roof insulation → U=0.14
- 8 Main windows (U=2.8, g=0.76) + 1 Ext1 window (U=1.4, g=0.72)
- Worcester Greenstar 30i (PCDF 17507) main + SAP 605 gas fire secondary
(Slice 58 mains-gas secondary fuel cost routing)
- Sheltered sides 1, 2 intermittent fans, 90% draught-proof, 23 LEDs
Adds an `001479` entry to `_FIXTURE_PINS` + `_FIXTURE_MODULES` in
`test_e2e_elmhurst_sap_score.py` with the worksheet PDF's 11
cascade-output line refs:
sap_score 69 (258)
sap_score_continuous 69.0094 "SAP value"
ecf 2.2215 (257)
total_fuel_cost_gbp 600.4001 (255)
co2_kg_per_yr 2687.3610 (272)
space_heating_kwh_per_yr 8103.7054 Σ (98c)
main_heating_fuel_kwh_per_yr 8194.7583 (211)
secondary_heating_fuel_kwh_per_yr 2025.9264 (215)
hot_water_kwh_per_yr 2358.3123 (219)
pumps_fans_kwh_per_yr 160.0000 (231)
lighting_kwh_per_yr 163.3584 (232)
Current state of the hand-built cascade vs worksheet:
Pin Cascade Expected PASS?
sap_score_continuous 65.99 69.01 no, -3.02
total_fuel_cost_gbp 658.92 600.40 no, +58.52
main_heating_fuel_kwh_per_yr 9359.6 8194.8 no
pumps_fans_kwh_per_yr 160.0 160.0 PASS
lighting_kwh_per_yr 163.4 163.4 PASS (after
LED/CFL split)
(... 9 others all failing by various deltas)
2/11 pins green. The remaining ~3 SAP gap means the hand-built has
input gaps that produce more loss/cost than Elmhurst's calc. Likely
suspects (slice candidates):
- HW demand: cascade likely over-counts (combi vs cylinder routing,
Tcold model)
- Internal gains: appliance + cooking energy share
- §2 ventilation tuning (chimney/flue counts, suspended-floor flag)
- Thermal mass parameter (250 default — confirm worksheet matches)
- Multiple-glazed proportion (cascade reads None → may default
unfavourably for solar gains)
Documents source-data caveat in the fixture docstring: Summary §3
says Ext1 age "M 2023 onwards"; worksheet header says "Ext1: L".
Hand-built uses 'L' to mirror the worksheet (which is the calc's
input source of truth); Elmhurst mapper produces 'M' from the
Summary — cross-mapper diff will flag this as a known caveat.
All 6 cohort cascade pins remain green at 1e-4 (66/66 fixture pins).
Pyright net-zero on the new fixture file.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| src/domain | ||
| pyproject.toml | ||
| README.md | ||
domna-domain
Shared domain types — Property, Properties, BaselinePerformance, Plan, PlanPhase, Scenario, ScenarioPhase, ScenarioSnapshot, Recommendation, OptimisedPackage, EpcPropertyData, etc.
Boundary: types only. No persistence, no IO, no business logic. Other packages and services depend on domna-domain; this package depends on nothing internal.
Domain definitions live in ../../CONTEXT.md. New types added here must match the glossary terms.
Layout
src/domain/
├── __init__.py
├── property.py # Property, Properties, PropertyIdentity
├── site_notes.py
├── landlord_overrides.py
├── baseline_performance.py # lodged + effective pair (ADR-0004)
├── plan.py # Plan, PlanPhase, OptimisedPackage
├── scenario.py # Scenario, ScenarioPhase, ScenarioSnapshot (ADR-0005)
├── recommendation.py
├── geospatial.py
├── solar.py
├── anomaly_flags.py
└── ml/
├── __init__.py
├── transform.py # EpcMlTransform (versioned per §8.3)
└── schema.py
When datatypes/epc/domain/ folds in, the EPC schema types move under src/domain/epc/.