Audit of raw-JSON keys vs RdSapSchema21_0_1 across the 9-fixture golden cohort surfaced 7 vent / draught fields silently dropped at deserialization: blocked_chimneys_count, open_flues_count, closed_flues_count, boilers_flues_count, other_flues_count, psv_count, has_draught_lobby. cert_to_inputs reads all of them for the §2 infiltration cascade; without them the calc treats every dwelling as flue-free / vent-free / no draught lobby and under-counts ACH. Fix: declare the 7 fields on RdSapSchema21_0_1; extend the mapper to surface blocked_chimneys_count on EpcPropertyData top-level (already declared) and the other 6 on SapVentilation (extends the slice 37 extract_fans_count work). has_draught_lobby coerces "true"/"false" strings to bool to match the SapVentilation type. Cohort residual shifts after re-pinning: - LN12 (0390-2254) — SAP +1 → 0 (FIRST CERT TO HIT LODGED SAP EXACTLY). blocked_chimneys=2 reduces infiltration, tightens both SAP and PE (PE −10.62 → −3.14, CO2 −0.11 → +0.04). - 0300 — PE +18.92 → +17.34, CO2 −0.43 → −0.54 (open_flues=1 + has_draught_lobby=true cross-cancel near-zero). - 0390-2954 — PE −25.62 → −27.64, CO2 −2.45 → −2.58 (has_draught_lobby=true). - 8135 — PE −17.58 → −14.37, CO2 −0.22 → −0.15 (blocked_chimneys=1). - Other 5 fixtures (0240, DE22, 6035, 7536, plus retired 9390): no shift — their certs lodge zeros or no vent fields beyond what Slice 37 plumbed. Rounded-SAP cohort distribution post-slice: 0 (LN12), +1 (8135), +2 (9390), +3 (7536), +8 (DE22, spec-drift), -6 (6035), -7 (0390-2954), -9 (0300), -12 (0240, RR-driven). Schema scope: 21.0.1 only. 21.0.0 schema's SapBuildingPart shares the same mapper code but no 21.0.0 fixtures live in the cohort to anchor against; defer to a future slice if needed. 930/930 Elmhurst cascade green. 14/14 golden cohort green at new pinned residuals. 77/77 mapper tests green. Pyright net-zero (34 errors before and after). 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