The Elmhurst Summary §14.0 "Main Heating EES Code" is a three-letter
identifier that resolves to the specific fuel for solid-fuel main
heating systems. The §14.0 "Main Heating SAP Code" alone can't
disambiguate because Table 4a categorises solid-fuel systems by
appliance type rather than fuel — SAP code 160 ("Closed room heater
with boiler") is shared by anthracite, wood chips, dual fuel and
smokeless across the heating-systems corpus.
Three changes land together:
1. `MainHeating` dataclass (`elmhurst_site_notes.py`) gains a
`main_heating_ees: str = ""` field for the §14.0 EES code.
2. `ElmhurstSiteNotesExtractor._extract_main_heating` reads "Main
Heating EES Code" from §14.0.
3. `_map_elmhurst_sap_heating` adds a fourth fuel-derivation
fallback (after the existing electric-SAP-code + §15.0-liquid-
fuel branches): when `main_fuel_int is None` and the §14.0 EES
code is in `_ELMHURST_MAIN_HEATING_EES_TO_FUEL_CODE`, use that
dict's value as the main fuel.
Dict (corpus-derived, 10 entries → 7 distinct Table 32 fuels):
BAF, BAI, RAM → 15 anthracite (3.64 / 0.395 / 1.064)
BCC → 11 house coal (3.67 / 0.395 / 1.064)
BDI → 10 dual fuel (3.99 / 0.087 / 1.049)
BKI → 12 smokeless (4.61 / 0.366 / 1.261)
BQI → 21 wood chips (3.07 / 0.023 / 1.046)
RPS → 22 wood pellets bags (5.81 / 0.053 / 1.325)
RUN → 23 bulk pellets (5.26 / 0.053 / 1.325)
RWN → 20 wood logs (4.23 / 0.028 / 1.046)
Dict values are Table 32 fuel codes, NOT API `main_fuel` enum codes
— the API codes 1-9 collide with Table 32 codes for unrelated fuels
(e.g. API 5 = "anthracite" vs Table 32 5 = "bottled LPG main
heating"). `unit_price_p_per_kwh` / `co2_factor_kg_per_kwh` /
`primary_energy_factor` all check the Table 32 dict before falling
through to the API translation, so using Table 32 codes here avoids
the collision and routes cost/CO2/PE through the correct fuel row.
Heating-systems corpus impact — all 10 solid-fuel variants move
from `_BLOCKED_BY_MISSING_MAIN_FUEL_TYPE` (assert-on-raise) back
onto the residual-pin grid in `_EXPECTATIONS`:
variant ΔSAP Δcost ΔCO2 ΔPE
solid fuel 2 +4.79 -£110 -484 kg +441 kWh anthracite
solid fuel 3 +4.43 -£102 -1206 +1452 anthracite
solid fuel 4 +4.13 -£95 -714 +1655 anthracite
solid fuel 5 +2.71 -£62 -301 +2360 house coal — smallest
solid fuel 6 -7.38 +£168 -154 +2519 dual fuel — only negative
solid fuel 7 +5.82 -£131 -758 +2968 smokeless
solid fuel 8 +4.24 -£98 -15 +2513 wood chips
solid fuel 9 +3.44 -£79 -8 +2428 wood pellets bags
solid fuel 10 +5.14 -£118 -53 +1849 wood pellets bulk
solid fuel 11 +4.35 -£100 -9 +1536 wood logs
Remaining residuals trace to heating-system efficiency / control
type — separate slices. 16 variants still in `_BLOCKED`: community
heating ×5, electric storage ×4, no system, oil non-Heating-oil ×5,
Bulk LPG ×1. Each is its own derivation slice.
Extended handover suite at HEAD post-slice: 876 pass / 0 fail (was
875 + 1 new EES wiring AAA test).
Pyright net-zero on touched files (45 → 45 — all pre-existing).
No golden fixture impact — no golden cert lodges an EES code via
the Elmhurst path.
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