mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Pins the EPC's published "Current Carbon" + "Current Primary Energy" values against the U985 Block 2 (postcode-climate cascade via PCDB Table 172) for all 6 Elmhurst fixtures at abs=1e-4. Adds: - `PrimaryEnergySection` dataclass exposing §13a line refs (275)..(286). - `primary_energy_section_from_cert(epc, postcode_climate=...)` — composes §9a per-system fuel kWh × Table 12 (gas) / Table 12e (electricity, monthly) PE factors. Handles (279) excludes (278a) electric-shower PE convention (mirrors §12 (265) excludes (264a)). - Real postcode on each Elmhurst fixture (bd3 8aq / bd3 9DR / bd5 8dn / bd3 9JZ / bd19 3TF / BD4 7JR) via new `postcode` kwarg on `make_minimal_sap10_epc`. - DEMAND_LINE_* constants per fixture for §9a annual kWh, §12 CO2 line refs (261..272), §13a PE line refs (275..286). - 16 cascade pins per fixture × 6 fixtures = 96 demand pins. EXACT match (000474, the canonical test): EPC Current Carbon (LINE_272) = 3104.1222 kg/yr ✓ (Summary PDF: 3.104t) EPC Current PE (LINE_286) = 16931.7227 kWh/yr ✓ Reference: SAP 10.2 Appendix U paragraph 1 (p.124) — "For ratings (SAP rating and environmental impact rating) the calculations are done with UK average weather. Other calculations (such as for energy use and costs on EPCs) are done using local weather. Weather data for each postcode district are taken from the PCDB." Full scoreboard: 840 rating-cascade pins + 96 demand-cascade pins + existing 5 postcode-weather unit tests = 941 total pins. Wider regression: 1585/1585 PASS — zero failures. 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/.