Model/packages/domain
Khalim Conn-Kowlessar b01164a2b6 Cohort residual slice 6: Table 3c row 1 helper + DVF piecewise (M+L / M+S)
Implements SAP10.2 Appendix J Table 3c row 1 (Instantaneous combi, two-
profile EN 13203-2 / OPS 26 tests):
    (61)m = (45)m × [r1 + DVF × F3] × fu + [F2 × n_m]

DVF (Daily Volume Factor) is piecewise in V_d,m, gated on the test
profile pair: M+L (PCDF separate_dhw_tests=2) or M+S (=3). Helper
`_table_3c_dvf` keeps the spec's piecewise branches close to the
formula in `combi_loss_monthly_kwh_table_3c_two_profile_instantaneous`.

Tests:
  - 000477 element-wise LINE_61 pin via Table 3c (PCDB 18118 lodges
    r1=0.015, F2=0.0, F3=0.00014; profile_pair=M+L). Closes 000477's
    combi-loss component at abs=1e-3 against U985 PDF.
  - Parametrized DVF boundary table for M+L (V<100, V=100, V=199.8,
    V>199.8) and M+S (V<36, V∈[36,100.2], V>100.2) at abs=1e-9.

Citation fix: parser docstring updates the BRE PCDF Spec reference from
the placeholder "v1.0 §7.11" to the actual Rev 6b (12 May 2021) Gas and
Oil Boiler Table, pp. 14-15 (now landed at docs/sap-spec/). Notes that
PCDF field 48's encoding (1=schedule 2 → profile M; 2=schedules 2+3 →
M+L; 3=schedules 2+1 → M+S) drives the Table 3b/3c row selection, and
that r2 (field 55) is lodged but spec-excluded from SAP.

Table 3c rows 2-5 (storage-FGHRS / storage-combi variants) and Table
3b rows 2-5 stay deferred — symmetric "row 1 only" coverage until a
fixture exercises them.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 13:37:44 +00:00
..
src/domain Cohort residual slice 6: Table 3c row 1 helper + DVF piecewise (M+L / M+S) 2026-05-22 13:37:44 +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/.