Closes the largest single localised fabric residual on cert 000565
(roof +1.59 W/K over, area +4.70 m² over) by routing
Connected-gable surfaces through a new `connected_wall` kind that
deducts area from the residual A_RR per the spec but contributes
0 W/K per RdSAP 10 Table 4 row 4.
RdSAP 10 §3.9.2 step (d) (PDF p.23) verbatim:
"The areas of gable walls are deducted from the calculated total
RR area, and the remaining area of RR, ARR_final is then
calculated. This area is treated as roof structure.
ARR_final = ARR_wall − (ΣARR_common_wall + ΣARR_gable +
ΣARR_party + ΣARR_sheltered +
ΣARR_connected)"
RdSAP 10 Table 4 row 4 (PDF p.22):
"ARR_connected — Adjacent to heated space — U-value = 0"
The U=0 means no heat-loss contribution, but the area STILL appears
in the deduction equation as ΣARR_connected. Pre-slice the mapper's
`_map_elmhurst_rir_surface` returned None for Connected gables,
dropping them entirely from `detailed_surfaces` so the cascade
neither billed them nor deducted them. The residual A_RR was
therefore over by their lodged area.
Cert 000565 Ext1 §8.1 lodges (Simplified Type 2):
Gable Wall 1 L=4.00 H=6.00 Connected U=0
Gable Wall 2 L=8.00 H=9.00 Exposed U=1.70
Common Wall 1 L=9.00 H=1.00 U=1.70
Common Wall 2 L=5.00 H=1.80 U=1.70
Gable Wall 1 area via §3.9.2 quadratic:
A_gable_1 = 4 × (0.25 + 6)
− (6 − 1)²/2 ← subtract triangle above Common Wall 1
− (6 − 1.8)²/2 ← subtract triangle above Common Wall 2
= 25.0 − 12.5 − 8.82
= 3.68 m²
Pre-slice:
A_RR shell = 12.5 × √(34 / 1.5) = 59.51 m²
Σ wall areas = 11.25 + 10.25 + 16.08 = 37.58 m²
Residual = 21.93 m² (worksheet: 18.25; over by +3.68)
Roof W/K = 21.93 × 0.35 = 7.68 (worksheet: 6.39; over by +1.29)
3-layer fix:
1. Mapper `_map_elmhurst_rir_surface` (datatypes/epc/domain/mapper.py)
now routes "Connected" gable_type to kind="connected_wall" with
u_value=0 and area via the Simplified Type 2 quadratic correction.
2. Heat transmission `heat_transmission_from_cert` (domain/sap10_
calculator/worksheet/heat_transmission.py) adds a connected_wall
branch that deducts area from rr_walls_in_a_rr_area but skips
walls/party W/K contribution.
3. AAA test pins Ext1 Connected gable area at 3.68 m² and U=0.
Movement at HEAD `b7fa5f74` → post-slice (cert 000565):
Fabric (cascade vs ws):
walls 602.53 → 602.53 (Δ -1.54 W/K; unchanged)
roof 52.97 → 51.68 (Δ +1.59 → +0.30 W/K; closes 81%)
TB 129.35 → 128.80 (Δ +0.70 → +0.15 W/K; closes 79%)
total area 862.34 → 858.66 (Δ +4.70 → +1.02 m²; closes 78%)
total W/K 937.40 → 935.54 (Δ +0.33 → -1.52 W/K; sign flips)
End-result pins:
**sap_score (int) 28 → 29 ✓ EXACT vs ws 29** (RECOVERED from
S0380.107 transient
rounding flip)
sap_score_continuous 28.4959 → 28.5380 (Δ -0.0128 → +0.0293)
ecf 5.3881 → 5.3838 (Δ +0.0015 → -0.0028)
total_fuel_cost_gbp 4681.39 → 4677.64 (Δ +1.13 → -2.62)
co2_kg_per_yr 6449.13 → 6444.27 (Δ +1.51 → -3.35)
space_heating_kwh 59028.80 → 58974.84 (Δ +20.5 → -33.5)
main_heating_fuel 34722.83 → 34691.09 (Δ +12.0 → -19.7)
lighting_kwh 1382.67 → 1382.67 (unchanged)
pumps_fans_kwh ✓ EXACT (unchanged)
Continuous SAP and downstream pins SIGN-FLIPPED again
(cascade was over post-.107, now under post-.108). Per user
direction: transient drift acceptable while closing a true
intermediate-value bug. The remaining net HTC -1.52 W/K is
mostly walls (-1.54 W/K) — closing the Detailed-RR walls
residual is the next leverage front.
Cohort safety: none of the 6 cohort certs lodge a Connected
gable (grep audit across all Summary fixtures). The new
`connected_wall` branch only fires for the cert 000565 Ext1 BP.
Test count: 606 pass + 8 expected 000565 fails → **608 pass +
7 expected 000565 fails** (sap_score back to exact + new
Connected-gable test green). Pyright net-zero per touched
file (57 baseline → 57 post-change).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
||
|---|---|---|
| .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