The PV β-factor cascade was prorating the annual hot-water fuel kWh uniformly by days when feeding D_PV,m per Appendix M1 footnote 32. The worksheet uses §4 (219)m = (62)m / efficiency monthly — which is seasonal (peaks in Jan when cold-mains-inlet drives energy content, troughs in Jul/Aug). For cert 0380: worksheet Jul (219) = 68.30 kWh vs cascade days-prorated 74.60 kWh — over-counted summer D_PV by ~6 kWh/month. Per Appendix M1 footnote 32: "D_PV,m = ... + E_water,m" where "E_water,m = (219)_m if water heating fuel code applied in Section 10a of the SAP worksheet is 30". (219)_m is the §4 fuel kWh per month, not annual / 12. Fix: scale `wh_result.output_monthly_kwh` to sum to the annual fuel `hw_kwh` (equivalent to dividing each month by the annual-average efficiency — exact for single-COP HP water heaters; close enough for PCDB combi winter/summer-split efficiencies because the annual total already accounts for the seasonal-efficiency mix). None fall- back to the legacy days-proration when wh_result is absent (TFA-missing certs). Cohort PE residual closure (kWh/m²): | Cert | Post-S0380.49 | Post-S0380.50 | |---|---:|---:| | 0350 | -2.96 | **-2.90** | | 0380 | -3.06 | **-2.96** | | 2225 | -3.73 | **-3.54** | | 2636 | -3.44 | **-3.28** | | 3800 | -3.25 | **-3.16** | | 9285 | -2.81 | **-2.74** | | 9418 | -3.01 | **-2.89** | Modest but real cohort closure (~0.1 kWh/m² each). The remaining ~3 kWh/m² traces to a small cascade β over-count (0.751 vs worksheet 0.739) — likely Appendix L monthly-weighting details for appliances/ cooking/electric-shower in D_PV; deferred to a follow-up slice. Cert 9501 (PV no battery) unchanged at +0.65 PE. CO2 cohort: <0.11 t/yr (within tolerance, re-pinned in same slice). SAP scores all exact. 763 pass + 0 fail. Pyright net-zero. |
||
|---|---|---|
| .devcontainer | ||
| .github/workflows | ||
| .idea | ||
| .vscode | ||
| applications | ||
| asset_list | ||
| backend | ||
| backlog | ||
| datatypes | ||
| deployment/terraform | ||
| docs/adr | ||
| domain | ||
| epr_data_exports | ||
| etl | ||
| infrastructure | ||
| model_data/requirements | ||
| orchestration | ||
| recommendations | ||
| repositories | ||
| scripts | ||
| sfr/principal_pitch | ||
| survey_report | ||
| tests | ||
| utilities | ||
| utils | ||
| .coveragerc | ||
| .dockerignore | ||
| .gitignore | ||
| __init__.py | ||
| 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_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