Promotes user-simulated "case 5" (detached, sandstone-walled, room-in-roof cousin of golden cert 0240) to an e2e worksheet fixture pinning the WHOLE extractor → mapper → calculator pipeline at abs=1e-4 on all 11 Block-1 line refs. Its worksheet prints the exact RR-gable routing S0380.196 implements, validating that fix against ground truth: Roof room Main Gable Wall 1 15.68 U=0.35 (29a) Exposed → walls @ main-wall U Roof room Main remaining area 61.73 U=0.30 (30) A_RR shell − Σ gables External roof Main 14.52 U=0.11 (30) loft residual Roof room Main Gable Wall 2 15.68 U=0.25 (32) Party → party @ 0.25 gable area = 6.40 × 2.45 (§3.9.1 default RR storey height); A_RR remaining = 12.5√(83.2/1.5) − 2×15.68 = 93.09 − 31.36 = 61.73 (RdSAP 10 §3.9.1(e)). Confirms a DETACHED dwelling can lodge a Party RR gable (Table 4 p.22 row 2) — so my S0380.196 mapping (gable_wall_type 0=Party, 1=Exposed) is correct; do not flip it. Two extractor/mapper gaps surfaced and fixed (case 5 is the forcing test): - Sandstone wall label "SS Stone: sandstone or limestone" had no `_ELMHURST_WALL_CODE_TO_SAP10` entry (raised UnmappedElmhurstLabel). Added "SS" → 2 (WALL_STONE_SANDSTONE), matching 0240's API wall_construction=2 (cross-mapper parity). - Roof "Insulation Thickness 400+ mm" was silently dropped: the four thickness parsers used `.split()[0].isdigit()`, which rejects the trailing "+" → None → u_roof fell back to the age-J default 0.16 instead of 0.11 (+1.09 W/K roof, the whole 0.12 SAP gap). Added `_parse_thickness_mm` (strips to leading digits) and applied it at all four sites (walls / alt-wall / roof / floor). The only existing fixture with "400+ mm" (000565 Stud Wall) routes via the RIR regex, unaffected. Result: case 5 cascade ≡ worksheet at 1e-4 on SAP/ECF/cost/CO2 + every energy stream. Neither gap affects 0240 (its API path captures both the sandstone code and "400mm+"); 0240's residual is therefore non-fabric. Suite: 2353 passed, 1 skipped. New code: 0 pyright errors. 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 | ||
| 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