RdSAP 10 §5.6 (PDF p.40) "U-values of uninsulated stone walls, age
bands A to E":
Table 12 — Default U-values of stone walls
Sandstone or limestone: U = 54.876 × W^(-0.561)
Granite or whinstone: U = 45.315 × W^(-0.513)
Where W is wall thickness in mm.
"Apply the adjustment according to Table 14: Insulation thickness
and corresponding resistance if wall is insulated or dry-lined
including lath and plaster."
Combined with §5.8 (PDF p.40) + Table 14 (PDF p.41) dry-line R = 0.17
m²K/W: U = 1 / (1/U₀ + 0.17).
Cert 000565 BP[0] Main alt1 is the cohort fixture: Stone Granite, age
band A (inherited from Main), 120 mm wall thickness, dry-lined.
§5.6 formula: U₀ = 45.315 × 120^(-0.513) ≈ 3.8871.
§5.8 + Table 14 dry-line: U = 1/(1/3.8871 + 0.17) ≈ **2.3405**.
→ matches worksheet U985-0001-000565 line (29a) "External walls Main
alt.1 ... SolidWallDensePlasterInsul, Solid, 0.0, 2.34" EXACT.
Pre-S0380.86 two coupled bugs blocked this path:
1. Mapper mis-name per [[feedback-no-misleading-insulation-type]]:
`_map_elmhurst_alternative_wall` routed the Elmhurst Summary §7
"Alternative Wall N Thickness" lodging (the WALL thickness)
onto `SapAlternativeWall.wall_insulation_thickness="120"`. The
cascade then mis-bucketed it as 100 mm insulation (bucket=100
→ _BRICK_INS_100 row at age A → U=0.32). The Elmhurst Summary
schema has no "Alternative Wall N Insulation Thickness" line at
all — `wall_insulation_thickness` on alts was always
semantically the wall thickness, never insulation.
2. `u_wall` had no §5.6 thin-wall stone branch. Stone constructions
fell through to Table 6 row values (designed for typical-
thickness ~300mm+ walls), which dramatically under-state heat
loss for sub-200mm stone.
Fix span:
- datatypes/epc/domain/epc_property_data.py:SapAlternativeWall:
new `wall_thickness_mm: Optional[int] = None` field, mirroring
`SapBuildingPart.wall_thickness_mm`.
- datatypes/epc/domain/mapper.py:_map_elmhurst_alternative_wall:
routes Elmhurst `a.thickness_mm` (Wall thickness) onto
`wall_thickness_mm`; leaves `wall_insulation_thickness=None`
on this path (no Elmhurst Summary alt-wall insulation-thickness
line exists).
- domain/sap10_ml/rdsap_uvalues.py:
new `_u_stone_thin_wall_age_a_to_e(construction, W)` helper
implements §5.6 Table 12 formulas. `u_wall` accepts a new
`wall_thickness_mm: Optional[int] = None` param; dispatches
§5.6 formula when (a) wall thickness lodged, (b) age band ∈
A-E, (c) construction ∈ {STONE_GRANITE, STONE_SANDSTONE}.
§5.8 + Table 14 R=0.17 applied on top when dry_lined=True.
- domain/sap10_calculator/worksheet/heat_transmission.py:
`_alt_wall_contribution_w_per_k` passes
`wall_thickness_mm=alt_wall.wall_thickness_mm` to `u_wall`.
Tests (7 new, AAA-structure):
- 5 in domain/sap10_ml/tests/test_rdsap_uvalues.py — granite at
120 mm with dry-line (U=2.34); granite raw formula (U=3.89);
sandstone (U=3.74); age-G gate (Table 6 row, NOT formula); no
wall_thickness fallback (Table 6 row 1.7).
- 2 in backend/documents_parser/tests/test_summary_pdf_mapper_chain
.py — mapper pin (wall_thickness_mm=120 on BP[0] alt1;
wall_insulation_thickness=None) and cascade pin (walls_w_per_k
≥ 595, post-S0380.85 was 555.93).
**Cert 000565 cascade walls: 555.93 → 602.40 W/K (worksheet 604.07;
0.27% residual).** BP[0] alt1 cascade U: 0.32 → 2.34. Cascade walls
within 2 W/K of worksheet target across S0380.85+.86 closure cycle.
Test baseline: 560 pass (was 558 + 7 new − 5 already passing pins
that moved) + 9 expected `test_sap_result_pin[000565-*]` fails
unchanged. Cohort + golden + cert 9501 unaffected: of the 6 cohort
fixtures only cert 000565 alt1 lodged a `wall_insulation_thickness`
value on `SapAlternativeWall` (audit confirmed) — and that value was
always semantically the wall thickness, so the rename is a fix not
a behaviour change. The API mapper path defaults `wall_thickness_mm`
to None (API schema doesn't yet surface alt-wall thickness; safe
forward-compat).
Per [[feedback-verify-handover-claims]]: the post-S0380.84 handover
predicted SH residual would close after the wall fixes. Empirically
SH grew +2591 → +6348 → +7924 across S0380.84/.85/.86 — confirming a
SEPARATE SH-channel over-count that's independent of fabric (each
+1 W/K of spec-correct walls adds ~33.5 kWh of cascade SH, vs the
worksheet's ~38.96 kWh/W/K rate). The walls fixes are spec-correct;
the SH over-count is now a single isolated open work-item for the
next slice (~+8 k kWh structural).
Pyright net-zero per touched file (test_rdsap_uvalues.py error count
actually decreased by 1).
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