From aa0c4fd3e9db8bfd32be5f1ed8f3c61681412dfd Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Tue, 12 Aug 2025 21:49:48 +0100 Subject: [PATCH] Debugging references in making funding paths --- recommendations/tests/test_optimisers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/recommendations/tests/test_optimisers.py b/recommendations/tests/test_optimisers.py index b4c739d5..6cb4a7ff 100644 --- a/recommendations/tests/test_optimisers.py +++ b/recommendations/tests/test_optimisers.py @@ -502,7 +502,7 @@ def _make_generic_eco4_funding_paths(p, input_measures, funding_paths, remaining heating_control_description=p.main_heating_controls["clean_description"] ) - if has_eligible_heating_system: + if has_eligible_heating_system and _find_measure(input_measures, "solar_pv"): single_solar_template = [{"AND": ["solar_pv"], "reference": None}] # We now look to pair this with any lingering insulation measures solar_paths = [] @@ -667,14 +667,18 @@ def make_funding_paths(p, input_measures, tenure): # 1) The package must include EWI or IWI if the property is privately owned # We check if we have any EWI or IWI measures available ewi_or_iwi = [{"OR": []}] + reference_measures = [] # If we have EWI we add it in if _find_measure(input_measures, "external_wall_insulation"): ewi_or_iwi[0]["OR"].append("external_wall_insulation") + reference_measures.append("ewi") if _find_measure(input_measures, "internal_wall_insulation"): ewi_or_iwi[0]["OR"].append("internal_wall_insulation") + reference_measures.append("iwi") if ewi_or_iwi[0]["OR"]: + ewi_or_iwi[0]["reference"] = "+".join(reference_measures) + ":eco4" funding_paths.append(ewi_or_iwi) funding_paths = _make_generic_eco4_funding_paths(