Closes 36 of the 50 mapper-vs-hand-built load-bearing divergences by
populating fields the Elmhurst mapper extracts but the original
cohort hand-built left at their `make_minimal_sap10_epc` / dataclass-
default values. Every change is cascade-equivalent — none alter
`_FIXTURE_PINS["000474"]` SapResult fields (all 11 1e-4 pins remain
GREEN against worksheet `SAP value 62.2584`).
Per-SapBuildingPart additions (Main, Ext1, Ext2):
- `wall_thickness_measured`: False → True. Summary §7 lodges Wall
Thickness 280 mm explicitly; the cascade doesn't read this field
(grep `wall_thickness_measured` across domain/sap/ returns no
consumer outside test fixtures), so flipping it is field-level-
only.
- `floor_type`, `floor_construction_type`, `floor_insulation_type_str`,
`floor_u_value_known`: surfaced from Summary §9 ("G Ground floor" /
"U Above unheated space" / "T Suspended timber" / "A As built" /
U-value Known = No). Strings carry the lodged text for cross-mapper
parity; cascade reads the int codes on SapFloorDimension.
- `roof_insulation_location`, `roof_insulation_thickness`: surfaced
from Summary §8 ("J Joists" + "100 mm"). Cascade's `u_roof` for
age B at thickness=100 returns the same 0.40 W/m²K as the age-B
default (thickness=None falls through to `_ROOF_BY_AGE['B']=0.40`),
so the cascade output is identical.
SapVentilation additions (all cascade-equivalent — `None` defaults to
0 throughout the §2 cascade chain):
- 6 explicit zero counts (`open_flues`, `closed_flues`, `boiler_flues`,
`other_flues`, `passive_vents`, `flueless_gas_fires`)
- `pressure_test="Not available"` (descriptive, no test was lodged)
- `draught_lobby=True` (the legacy field; cascade reads
`has_draught_lobby=False` which is set already, so True on the
legacy field has no cascade effect)
Top-level additions via `make_minimal_sap10_epc`:
- `extensions_count=2` (Slice 54 fix on mapper made this surface; the
hand-built was carrying the pre-Slice-54 hard-coded 0)
- `blocked_chimneys_count=0`, `dwelling_type="Mid-Terrace house"`,
`built_form="Mid-Terrace"`, `property_type="House"`
Post-construction mutations (helper doesn't expose these as kwargs):
- `has_conservatory=False`, `any_unheated_rooms=False`,
`number_of_storeys=2`, `hydro=False`, `photovoltaic_array=False`
Diff count: 50 → **14**. The remaining 14 are real semantic gaps for
the next slices to close:
Cat B (mapper needs to surface 7 fields):
- country_code (Elmhurst mapper produces None; should set 'ENG')
- sap_heating.water_heating_fuel (None vs 26 — gas main heating
should imply gas water heating fuel)
- main_heating_details[0].boiler_flue_type (None vs 2 — Summary
§14.1 lodges "Balanced" flue type)
- main_heating_details[0].emitter_temperature ('Unknown' vs 1)
- main_heating_details[0].main_heating_number (None vs 1)
- sap_ventilation.has_draught_lobby (None vs False)
- dual-encoded central_heating_pump_age int/str
Cat C (structural shape, 2 diffs):
- sap_windows: LEN 7 vs 5 (mapper 1:1 with §11 table vs hand-built
collapsed by glazing-type group, preserving total area —
cascade-equivalent but not field-equal)
- sap_building_parts[*].party_wall_construction: None vs 0
(cohort convention sentinel; the cohort 000474 docstring
established `0 = "Unable to determine"`)
Cat B handbuilt-needs (hand-built should add 2 fields the mapper
already surfaces):
- sap_heating.shower_outlets (mapper extracts 'Non-electric shower')
- sap_heating.number_baths (mapper extracts 1)
11 cohort cascade pins still GREEN; pyright net-zero (0 errors on
the touched fixture file). Tracer-bullet diff test stays RED with
14 divergences (was 50).
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