mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
The API schema lodges `glazing_type` (int code) per window but `window_transmission_details=None` and `frame_factor=None`. Without per-window U lodgement the cascade falls back to a single global `u_window(None,None,None)=2.5` × total area, which over-shot cert 001479's window W/K by +2.63 (cascade 46.23 vs worksheet 43.60). Fix: `_API_GLAZING_TYPE_TO_TRANSMISSION` lookup translates `glazing_type` → (u_value, solar_transmittance, frame_factor) and the mapper populates `WindowTransmissionDetails` + `frame_factor` per window so the cascade uses its per-window U fast path (each window contributes A × U_eff_individual rather than total_area × U_eff_global). Two codes mapped now: 3 → DG pre-2002 U=2.8 g=0.76 FF=0.70 13 → DG post-2022 Argon U=1.4 g=0.72 FF=0.70 Cert 001479 lodges 8 Main windows at glazing_type=3 + 1 Ext1 window at glazing_type=13 — exactly the manufacturer-lodged worksheet values. The cascade now matches the worksheet's `Windows 1: 13.96 × 2.518 = 35.15 W/K` and `Windows 2: 6.37 × 1.3258 = 8.45 W/K` → **windows W/K EXACT 43.5962**. **Cert 001479 API path: fabric heat loss is now COMPLETELY EXACT across all 6 components** (walls/party/roof/floor/windows/doors all match worksheet at the worksheet's 4 d.p. precision). Total fabric: 139.4957 W/K ✓ (was 122.6130 before Slice 87) walls: 39.7652 ✓ party walls: 17.0700 ✓ roof: 10.3438 ✓ floor: 23.1705 ✓ windows: 43.5962 ✓ doors: 5.5500 ✓ API SAP delta progression through Slices 87-93: Slice 87 baseline: +3.0752 After Slice 90: +1.5298 (party walls) After Slice 91: +1.0970 (descriptive strings + roof desc) After Slice 92: +1.0022 (floor dims) After Slice 93: +1.1846 (windows — fabric now EXACT) The +1.18 SAP gap is now PURELY non-fabric: candidates are internal gains, solar gains, ventilation, MIT, or hot water cascade — to diagnose in the next slice. Golden cert residuals updated for the cascade improvements. Pyright net-zero on mapper.py (33 → 33). 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/.