ASHP cost sizes to the threaded design heat loss over the floor-area proxy 🟩

_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 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-03 10:29:50 +00:00
parent 6f70e65bc4
commit b25e7bb7f9

View file

@ -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=(