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> |
||
|---|---|---|
| .devcontainer | ||
| .github/workflows | ||
| .idea | ||
| .vscode | ||
| asset_list | ||
| backend | ||
| backlog | ||
| datatypes | ||
| docs | ||
| epr_data_exports | ||
| etl | ||
| infrastructure/terraform | ||
| model_data/requirements | ||
| packages | ||
| recommendations | ||
| scripts | ||
| services | ||
| sfr/principal_pitch | ||
| survey_report | ||
| utils | ||
| .coveragerc | ||
| .dockerignore | ||
| .gitignore | ||
| __init__.py | ||
| AGENTS.md | ||
| ara_backend_design.md | ||
| BaseUtility.py | ||
| CLAUDE.md | ||
| conftest.py | ||
| CONTEXT.md | ||
| devcontainer.sh | ||
| Dockerfile.test | ||
| Dockerfile.test.dockerignore | ||
| Makefile | ||
| MEMORY.md | ||
| package-lock.json | ||
| package.json | ||
| pyproject.toml | ||
| pyrightconfig.json | ||
| pytest.ini | ||
| README.md | ||
| run_backlog.sh | ||
| run_lambda_local.sh | ||
| serverless.yml | ||
| test.requirements.txt | ||
| tox.ini | ||
| UBIQUITOUS_LANGUAGE.md | ||
Model Repository
This repository contains the code pertaining to the development of the data science and machine learning products being utilised by Hestia.
The different folders in this repository relate to services that can be used independently, or can be imported and used as part of a larger application
Getting Started
Prerequisites
Dev Container Setup
This repo uses a Docker Compose-based dev container. The model-backend service joins a shared-dev Docker network so it can communicate with other local services (e.g. a frontend container) running on your machine.
VS Code users: The initializeCommand in devcontainer.json creates the shared-dev network automatically before the container starts. No manual step required — just open the repo and select Reopen in Container.
Non-VS Code / CI workflows: Run the following once before starting the container:
make dev-setup
This is idempotent and safe to re-run if the network already exists.
Folders
backend/
This folder contains the code for the fastapi backend service, which provides an interface to much of the functionality in this repository, for the frontend
model_data/
This folder contains related to the reading and preparation of assessment model data, including pulling out epc attributes
Testing
All tests can be run, against the configuration in pytest.ini running
pytest
This will run the complete panel of tests and report on coverage in the locations specified by the pytest.ini file.
To run tests in a specific service, e.g. inside of model_data, simply run
pytest --cov-config=model_data/.coveragerc --cov=model_data
This will produce the test results and coverage reports