Model/packages/domain
Khalim Conn-Kowlessar 74bfac049a Slice 30: §10a fuel costs cascade pin (192/192) + electric-shower plumb
Adds `fuel_cost_section_from_cert(epc)` (delegates to `cert_to_inputs`
which already wires `_fuel_cost` with full upstream context). Pins
(240a)..(255) — 32 line refs × 6 fixtures = 192 cascade pins, all PASS.

Three calculator changes needed for closure:

1. Electric shower (247a) — for 000487 the cert lodges 1 electric shower
   and the PDF reports (247a) = 79.3036 GBP (= (64a)m × std electricity
   price). The §4 cascade already computes electric-shower kWh via
   App J step 8 (slice 25d); now exposed on `WaterHeatingResult` as
   `electric_shower_kwh_per_yr` and plumbed into `_fuel_cost`. The
   instant-shower input was previously hardcoded to 0.

2. (241a/241b) main 2 + (242a/242b) secondary fractions — when a row's
   kWh is zero the PDF reports BOTH high/low fractions as 0 (not 1/0).
   `_split` in fuel_cost now zeros both fractions when kwh_per_yr <= 0.
   Cost columns already collapse via multiplication, so this is
   presentation-only.

3. (242a/242b) secondary fractions for 000474 — same pattern: when no
   secondary system is lodged, both fractions = 0.

Adds §10a LINE_ constants to all 6 fixtures. Extracted from
`sap worksheets/U985-0001-NNNNNN.txt` PDF blocks.

Cascade scoreboard: 468/468 → 660/660 (§7..§10a closed).
e2e SapResult: 6 remaining failures (all `co2_kg_per_yr`, await §12).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 00:42:52 +00:00
..
src/domain Slice 30: §10a fuel costs cascade pin (192/192) + electric-shower plumb 2026-05-24 00:42:52 +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/.