mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Closes the `sap_windows: LEN 7 vs 5` divergence by replacing the cohort hand-built's glazing-type-collapsed 5-window encoding with 7 SapWindow entries mirroring the Summary §11 1:1 — the same row breakdown the Elmhurst mapper extracts. Per-window curtain-transform U_eff aggregates to the same total as before: Group g=0.72/U=2.0: 6.22 m² across 4 rows (was 3 rows × wider W) Group g=0.76/U=2.8: 5.50 m² across 3 rows (was 2 rows × wider W) Cascade output is unchanged — all 11 cohort 000474 SapResult pins remain GREEN at 1e-4. The per-bp window apportionment from Slice 59 (`_window_bp_index` in heat_transmission_from_cert) handles both the prior int-zero `window_location` and the new "Main"/"Nth Extension" str locations the mapper surfaces; cohort 000474 has uniform per-bp wall U so the apportionment is heat-loss-invariant either way. Surfaces a previously-hidden gap: now that the LEN matches, the diff test reveals **49 per-window sub-field divergences** between the cohort `make_window` helper (API-style int codes for `glazing_type`, `window_type`, `window_wall_type`, `glazing_gap`, `data_source`, bool `permanent_shutters_present`, None `frame_factor`) and the Elmhurst mapper (Summary-style strings for the same fields + `frame_factor=0.7`). That's the next chunk to address — most likely path: normalise the Elmhurst mapper to produce API-style int codes for the window descriptive fields, so both mappers produce the same dataclass shape. The cascade reads `window_transmission_details.u_value` / `solar_transmittance` + `window_width` × `window_height` + `orientation` + `window_location` — none of the descriptive divergences listed above affect SAP output. Diff count: 1 → 49 (surface, not regression). Cohort cascade pins green; pyright 0 errors on the fixture. 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/.