Debugging references in making funding paths

This commit is contained in:
Khalim Conn-Kowlessar 2025-08-12 21:49:48 +01:00
parent e3066fbd76
commit aa0c4fd3e9

View file

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