Model/packages/domain
Khalim Conn-Kowlessar a41ac6bd74 Cohort residual slice 4: SAP 10.2 rating constants — 000490 closes to delta=0
Replaces the SAP 10.3 §13 rating constants in `worksheet/rating.py`
with SAP 10.2 values per ADR-0010 (active spec target is SAP 10.2,
14-03-2025; spec changed to SAP 10.3 only as of 13-01-2026 which
hasn't been adopted):

  Energy Cost Deflator         0.36 → 0.42
  Linear branch slope          16.21 → 13.95   (SAP = 100 − slope × ECF)
  Log branch intercept         108.8 → 117.0   (SAP = intercept − slope × log10(ECF))
  Log branch slope             120.5 → 121.0

The two errors were near-cancelling on the Elmhurst cohort (low-cost
combi-gas dwellings on the linear branch): the wrong deflator made
our ECF ~14% low, and the wrong linear slope made our SAP drop per
unit ECF ~16% high. Their product was close to the spec but not
exactly — leaving 000490 stuck 1 SAP integer over PDF after the
other component closures (Appendix L, secondary heating, ventilation,
pumps_fans) had brought cost to within £0.04 of PDF.

Final cohort SAP integer status — **both fixtures hit delta=0**:

  000474:  integer 62 = PDF 62 (continuous 61.91 vs PDF 62.26, Δ -0.35)
  000490:  integer 57 = PDF 57 (continuous 57.40 vs PDF 57.40, Δ -0.002)

000490 e2e SAP integer ceiling tightened 1 → 0.

Updated 8 internal rating + calculator tests that pinned the SAP 10.3
constants (test_rating.py, test_calculator.py, test_bre_worked_
examples.py). All 685 tests green; 0 xfail.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 11:25:38 +00:00
..
src/domain Cohort residual slice 4: SAP 10.2 rating constants — 000490 closes to delta=0 2026-05-22 11:25:38 +00:00
pyproject.toml slice 13: to_rows(properties) returns pd.DataFrame 2026-05-16 16:43:28 +00:00
README.md added potential file scaffolding: 2026-05-15 10:56:53 +00:00

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/.