SAP §2 (9) "ns" is the dwelling height — the tallest part — which drives the (10) additional-infiltration adjustment. Pre-fix code summed `len(sap_floor_dimensions)` across parts and incremented for every sap_room_in_roof block, so a 2-storey main + 1-storey side extension returned ns=3 instead of 2, and a 2-part RR-bearing cert could return ns=4 or 5. The (10) ach output overstated by 0.1 per spurious storey. Fix tracks per-part `(floor_count + 1 if RR else 0)` and emits `max(per_part)`. TFA and volume sums on §1 are unaffected — those are genuine Σ per RdSAP §3.9.1. Surfaced by Elmhurst 000474 (2-storey + 2 side extensions): worksheet says ns=2; we previously had to pass `storey_count=fixture.LINE_9_STOREYS` explicitly in the §2 Elmhurst conformance test. With the fix, the test now derives `storey_count` from `dims.storey_count` and the `LINE_9_STOREYS` field cross-checks the derivation against (9). Tests: - New: dwelling_storey_count_is_max_across_parts_not_sum (2-storey main + 1-storey ext expects ns=2) - New: room_in_roof_on_main_adds_one_to_dwelling_storey_count_only_once (main with RR + ext without RR expects ns=3, not 5) - Updated: main_plus_extension_sums_areas_perimeters_and_walls assertion ns==2 → ns==1 (both parts single-storey) - Updated: all_rir_shapes_apply_section_1_2_45m_convention_uniformly — storey_delta is now ≤1 not len(parts_with_rr); TFA/volume deltas remain Σ per the spec - Updated: §2 Elmhurst test consumes dims.storey_count + asserts dims.storey_count == fixture.LINE_9_STOREYS as an Arrange precondition 826 tests pass. 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