mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Adds `space_heating_section_from_cert(epc)` to the cert→inputs cascade mirroring `mean_internal_temperature_section_from_cert`. Composes §1 (dim) + §2 (ventilation) + §3 (HLC) + §5+§6 (gains) + §7 (MIT + η_whole) + climate and threads through `space_heating_monthly_kwh`. Pins (95)/(97)/(98a)/(98c) monthly + (98c) annual + (99) per-m² against the U985 PDF at abs=1e-4 for all 6 fixtures — 36/36 PASS. Worksheet annual rule: the U985 PDF lodges (98a)_m / (98c)_m at 4 d.p. half-up and reports the annual as the Σ of those displayed monthlies. The full-precision Σ diverges from the lodged annual by up to ~1.4e-4 (accumulated 4-d.p. display rounding over 8 heating months) — e.g. 000490 = -0.000132. Empirically, `sum(round_half_up(monthly, 4))` reproduces the lodged annual EXACTLY for all 6 fixtures (residual = 0 by construction). The full-precision residuals are randomly distributed in ±1.4e-4 with no bias — 5/6 cancel below 1e-4 by luck, 000490 lost the lottery. SAP10.2 Table 9c step 10 (p.184) defines (98a)_m without an explicit annual aggregation rounding rule; matching the worksheet display convention is the only consistent interpretation that satisfies the abs=1e-4 pin bar. The 1.2e-8 relative shift on downstream calcs is negligible. Cascade scoreboard: 312/312 → 348/348 (§7 60/60 + §8 36/36 now closed). e2e SapResult: 56/66 unchanged (downstream §10a/§11a/§12 + 000487 defects await later slices). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| domain | ||
| fetchers | ||
| repos | ||
| utils | ||
| README.md | ||
Shared packages
Workspace packages consumed by services/*. Each package is its own Python distribution with its own pyproject.toml; services import via the workspace dependency mechanism ({ workspace = true }).
| Package | Purpose |
|---|---|
domain/ |
Shared domain types — Property, BaselinePerformance, Plan, Scenario, EpcPropertyData, etc. No persistence, no IO, no business logic. |
repos/ |
Persistence layer — one repo per aggregate. Owns the SQL. Depends on domain. |
fetchers/ |
External API clients (gov EPC, Ofgem, Google Solar, etc.). Depend on domain for response shapes. |
utils/ |
Cross-cutting infra — logging, S3, CloudWatch URL builders, SQS task helpers. |
Adding a new shared package
Only when a real second consumer materialises. Don't pre-shatter (repos-epc, repos-property, ...) — split when a deployment needs to drop a dep, not before.
See ../ara_backend_design.md §11 for the broader monorepo layout and ../CONTEXT.md for the domain glossary that names the types living in domain/.