The PV onsite/export β-split (SAP 10.2 Appendix M1 §3a, p.93) divides PV generation by the monthly PV-eligible electricity demand D_PV,m. The cascade included main and water electricity (when those fuels are electric) but had no term for SECONDARY space heating. For the 10 cohort-2 gas-main + electric-secondary + PV certs, the (215)m secondary electric fuel was dropped from D_PV,m — understating demand in the heating months only, depressing the monthly β, and under-crediting onsite PV primary energy. Spec: Appendix M1 §3a counts E_space,m as the dwelling's TOTAL electric space-heating demand; for a gas-main/electric-secondary dwelling that is the secondary fuel. Diagnosis was decisive: E_PV (generation) matched the worksheet exactly every month, the onsite (233a) split diverged ONLY in heating months (Jun-Sep near-exact), and all 10 affected certs have PV while all clean gas certs have none. Empirically adding (215)m to D_PV closed cert 3136 onsite 726.9 → 790.3 (worksheet 792.1). Impact (calc − full-precision dr87 worksheet), the 10 certs: PE +0.5..+1.5 → +0.02..+0.046 kWh/m²; CO2 −0.5..−1.1 → +0.002..+0.0095 kg. The whole 47-cert cohort now matches at PE <0.05 / CO2 <0.025. SAP integers unchanged; chain SAP 1e-4 pins intact (164 pass). The uniform ~0.03 PE remnant on PV certs is the separate (233a)/(233b) summer-month D_PV discrepancy. Re-pinned the 10 worksheet + 9 lodged golden residuals (improvements). 2273 pass, 0 regressions; pyright net-zero (file's 32 errors pre-existing). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .devcontainer | ||
| .github/workflows | ||
| .idea | ||
| .vscode | ||
| applications | ||
| asset_list | ||
| backend | ||
| backlog | ||
| datatypes | ||
| deployment/terraform | ||
| docs | ||
| domain | ||
| epr_data_exports | ||
| etl | ||
| infrastructure | ||
| model_data/requirements | ||
| orchestration | ||
| recommendations | ||
| repositories | ||
| sap worksheets/heating systems examples | ||
| 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