Contains projects associated to the development of modeling products
Find a file
Khalim Conn-Kowlessar 4d0e2ed6cf Slice S0380.162: SAP 10.2 Appendix N3.1 default pump gain for electric HPs
SAP 10.2 Appendix N3.1 (PDF p.105) "Circulation pump and fan":
"For electric heat pumps: The electricity used by the water
circulation pump or fan is included within the calculated annual
space and hot water heating efficiency and is not included in
worksheet (230c). **The default heat gain from Table 5a is included
via worksheet (70).**"

This rule applies the Table 5a row "Central heating pump in heated
space" GAIN (3 / 10 / 7 W per pump-age bucket) to electric heat
pumps even though the pump ELECTRICITY is hidden in the COP and
excluded from (230c). The "Not applicable for electric heat pumps
from database" clause in Table 5a footnote a) scopes only to the
PCDB-Table-362 cascade case (Appendix N1.2.1: "For heat pumps held
in the PCDB ... a single water circulation pump serving the heat
emitters is sufficient" — pump kWh AND gain embedded in COP).

S0380.160 over-stripped the gain by zeroing pump_w for every HP
category-4 main, conflating the PCDB-Table-362 case with the Table-4a
default cascade. This slice refines the HP gate in
`_any_main_system_has_central_heating_pump`:
  - Cat 4 HP WITH `main_heating_index_number` lodged (PCDB Table
    362) → continue (skip; pump in COP per N1.2.1);
  - Cat 4 HP with SAP code in `_TABLE_4A_WARM_AIR_SAP_CODES` (Cat 5
    warm-air HPs distribute via ducted air, no water circulation
    pump; warm-air fan handled separately by Table 5a "Warm air
    heating system fans" row, S0380.161) → continue;
  - Otherwise (Cat 4 HP, Table 4a default cascade, water-emitter)
    → apply Table 5a default per Appendix N3.1.

Per-line walk on ashp (SAP code 214 air-to-water HP, Cat 4, no PCDB,
"Post 2013" pump age):
  worksheet (70)[Jan] = 3.0000 W
  cascade pre-slice    = 0.0000 W      delta = -3.000 W
The -3 W winter gain shortfall over-stated cascade (84) Total gains
by -3 W in heating months → cascade SH demand +12.27 kWh/yr
(cascade 9302 vs worksheet 9290), pushing continuous SAP down 0.024
because the cost residual was driven by the +1.5 kWh × 12 month
shortfall flowing through the £0.0741 low-rate cost.

Closures:
  ashp:  ΔSAP -0.0240 → +0.0000 EXACT, Δcost +£0.55 → +£0.00 EXACT
  gshp:  ΔSAP -0.0178 → -0.0000 EXACT, Δcost +£0.41 → -£0.00 EXACT

ΔPE +36 → +25.51 (and ΔCO2 +7.33 → +6.31) — residuals narrow to the
Elmhurst-vs-spec HW PE annual-vs-monthly Table 12e/12d quirk only
(same pattern as the 16-variant lighting-PE deferred cohort,
scaled by HW kWh = 1138 vs 2384 → 25.51 vs 48.66). Cohort
Σ |ΔSAP_c| 0.07 → 0.03; all 25 cascade-OK variants now SAP+cost EXACT.

Cohort-1 (cert 0380 et al.) golden fixtures unaffected — those certs
lodge `main_heating_index_number` (PCDB Table 362) → HP gate skips
correctly → (70) = 0 preserved. Cert 000565 (HP main 1 + gas boiler
main 2) unaffected — wet-boiler branch fires for main 2.

Verbatim spec quote (SAP 10.2 Appendix N3.1, PDF p.105):
  "For electric heat pumps: The electricity used by the water
   circulation pump or fan is included within the calculated annual
   space and hot water heating efficiency and is not included in
   worksheet (230c). The default heat gain from Table 5a is
   included via worksheet (70)."

Tests: 906 pass (+1), 0 fail. Pyright net-zero (35 → 35).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 15:40:25 +00:00
.devcontainer pr review, move domain and orhcestration 2026-06-01 14:00:31 +00:00
.github/workflows deploy lambda 2026-06-04 15:32:51 +00:00
.idea scaffolding for ml pipeline 2026-05-16 14:15:56 +00:00
.vscode added utils to allow easier subtask management 2026-03-02 15:15:39 +00:00
applications reformatted to be DDD structure 2026-06-04 14:50:04 +00:00
asset_list redeploy old postcode splitter 2026-05-21 09:46:47 +00:00
backend Slice S0380.162: SAP 10.2 Appendix N3.1 default pump gain for electric HPs 2026-06-04 15:40:25 +00:00
backlog implemented onboarding 2026-04-21 20:23:33 +00:00
datatypes Merge remote-tracking branch 'origin/main' into feature/landlord_data 2026-06-01 17:02:20 +00:00
deployment/terraform tests files 2026-06-04 11:47:42 +00:00
docs reformatted to be DDD structure 2026-06-04 14:50:04 +00:00
domain Slice S0380.162: SAP 10.2 Appendix N3.1 default pump gain for electric HPs 2026-06-04 15:40:25 +00:00
epr_data_exports allowing carbon and energy otimisation by removing slack 2025-07-31 19:13:16 +01:00
etl booking status 2026-06-01 16:28:47 +00:00
infrastructure tests files 2026-06-04 11:47:42 +00:00
model_data/requirements its working the way khalim wanted wiht postcode and then search that 2026-01-22 15:17:13 +00:00
orchestration reformatted to be DDD structure 2026-06-04 14:50:04 +00:00
recommendations save 2026-05-07 15:55:44 +00:00
repositories reformatted to be DDD structure 2026-06-04 14:50:04 +00:00
scripts feat(ingestion): relocate EpcClientService to infrastructure + SolarRepo (#1133) 2026-06-01 16:28:48 +00:00
sfr/principal_pitch added added historic epc data class with shape 2026-05-08 12:03:35 +00:00
survey_report quidos site notes extraction 2025-02-18 19:49:29 +00:00
tests reformatted to be DDD structure 2026-06-04 14:50:04 +00:00
utilities get rid of comments 2026-05-20 13:21:11 +00:00
utils rename files in sharepoint to desired structure 2026-05-20 16:26:07 +00:00
.coveragerc fixed unit tests 2023-10-05 16:04:12 +01:00
.dockerignore deployment from infrastructure 2026-05-19 12:55:30 +00:00
.gitignore fixed merge conflicts from main 2026-05-26 11:21:09 +00:00
__init__.py added checking for directory before creation and made some minor style changes 2023-08-25 15:21:17 +01:00
ara_backend_design.md refactor: lift-and-shift packages/domain/src/domain/ml → domain/sap10_ml 2026-05-26 13:01:35 +00:00
BaseUtility.py fixed missing task and subtask for single remote assessments 2025-11-27 17:50:26 +00:00
CLAUDE.md fixed merge conflicts from main 2026-05-26 11:21:09 +00:00
conftest.py working on integrating new EPC api into address2UPRN 2026-04-27 11:32:44 +00:00
CONTEXT.md feat(baseline): BaselineOrchestrator + BaselinePerformance aggregate (#1135) 2026-06-01 16:28:48 +00:00
devcontainer.sh add dev container 2026-04-17 14:50:57 +00:00
Dockerfile.test fix: address 22 project-wide test failures from previous sweep 2026-05-26 13:34:51 +00:00
Dockerfile.test.dockerignore deployment from infrastructure 2026-05-19 12:55:30 +00:00
Makefile adding to dev container to create shared network on start up 2026-04-25 15:03:07 +00:00
MEMORY.md memory 2026-04-02 10:24:31 +00:00
package-lock.json restructuring openUrpn code 2023-07-20 11:41:43 +01:00
package.json restructuring openUrpn code 2023-07-20 11:41:43 +01:00
pyproject.toml slice 14a: ml_training_data pkg + sample.py (CSV filter + random sample) 2026-05-16 17:39:43 +00:00
pyrightconfig.json slice 14d: build_features wires bulk reader -> mapper -> EpcMlTransform 2026-05-16 18:38:41 +00:00
pytest.ini tests files 2026-06-04 11:47:42 +00:00
README.md adding to dev container to create shared network on start up 2026-04-25 15:03:07 +00:00
run_lambda_local.sh debugging local lambda run and updating the sap point checking condition 2023-09-13 18:47:12 +01:00
serverless.yml added logic to add to serverless 2026-04-22 12:39:44 +00:00
test.requirements.txt tests wrong environemnt 2026-05-29 16:17:06 +00:00
tox.ini removing playright install for integration test 2026-04-30 20:08:13 +00:00
UBIQUITOUS_LANGUAGE.md standardist Address 2026-06-01 16:32:48 +00:00

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