Model/tests/domain/test_building_geometry.py
Khalim Conn-Kowlessar 0ba0575877 feat(modelling): shared gross heat-loss wall area geometry helper
domain/building_geometry.gross_heat_loss_wall_area(epc, identifier) sums
heat_loss_perimeter x room_height across a building part's storeys — the
heat-loss wall area (party walls excluded by construction), not total
wall area. Lives outside the calculator so Modelling cost quantities can
reuse it; the calculator computes the same quantity inline today and
should be DRY'd onto this later (coordinated with the calculator branch).

Pinned at 45.93 m^2 against the 000490 MAIN part. Toward #1155 cost
(behaviour 4). pyright strict clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 22:53:12 +00:00

22 lines
869 B
Python

"""Behaviour of shared building geometry derived from EpcPropertyData —
reusable outside the SAP calculator (e.g. for Modelling cost quantities)."""
from datatypes.epc.domain.epc_property_data import BuildingPartIdentifier
from domain.building_geometry import gross_heat_loss_wall_area
from tests.domain.sap10_calculator.worksheet._elmhurst_worksheet_000490 import (
build_epc,
)
def test_gross_heat_loss_wall_area_sums_perimeter_times_height_per_storey() -> None:
# Arrange
# 000490 MAIN: floor 0 (perimeter 7.42 m x height 2.95 m) + floor 1
# (7.42 m x 3.24 m) = 21.889 + 24.0408 = 45.93 m^2. Party walls are
# excluded by construction (heat-loss perimeter, not total perimeter).
epc = build_epc()
# Act
area: float = gross_heat_loss_wall_area(epc, BuildingPartIdentifier.MAIN)
# Assert
assert abs(area - 45.93) <= 0.01