From b25e7bb7f9008726840a90305fb29c42405780d1 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 3 Jul 2026 10:29:50 +0000 Subject: [PATCH] =?UTF-8?q?ASHP=20cost=20sizes=20to=20the=20threaded=20des?= =?UTF-8?q?ign=20heat=20loss=20over=20the=20floor-area=20proxy=20?= =?UTF-8?q?=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _ashp_option threads its sized design heat loss into ashp_cost_inputs so the cost band and the pump's efficiency record share one figure — a leaky dwelling's larger pump is priced on the matching band. Co-Authored-By: Claude Opus 4.8 --- domain/modelling/generators/heating_recommendation.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/domain/modelling/generators/heating_recommendation.py b/domain/modelling/generators/heating_recommendation.py index 7efbc05a4..44173de98 100644 --- a/domain/modelling/generators/heating_recommendation.py +++ b/domain/modelling/generators/heating_recommendation.py @@ -293,10 +293,15 @@ def ashp_cost_inputs( back to the floor-area proxy so cost and pump size share one figure.""" system: AshpExistingSystem = _existing_system(epc) floor_area: float = epc.total_floor_area_m2 + heat_loss_kw: float = ( + design_heat_loss_kw + if design_heat_loss_kw is not None + else floor_area * _KW_PER_M2 + ) return AshpCostInputs( existing_system=system, is_small_property=floor_area <= _SMALL_PROPERTY_MAX_M2, - design_heat_loss_kw=floor_area * _KW_PER_M2, + design_heat_loss_kw=heat_loss_kw, radiator_count=_radiator_count(epc), has_reusable_wet_system=system in (AshpExistingSystem.GAS, AshpExistingSystem.OIL, AshpExistingSystem.LPG), @@ -762,7 +767,9 @@ def _ashp_option( # single catalogue scalar; the catalogue row is read only for its id, so an # absent ASHP row must not suppress the bundle — it just carries no id. product: Optional[Product] = products.get_optional(_ASHP_MEASURE_TYPE) - cost: Cost = Products().ashp_bundle_cost(ashp_cost_inputs(epc)) + cost: Cost = Products().ashp_bundle_cost( + ashp_cost_inputs(epc, design_heat_loss_kw=heat_loss_kw) + ) return MeasureOption( measure_type=_ASHP_MEASURE_TYPE, description=(