fixed bug in fabric only eco4

This commit is contained in:
Khalim Conn-Kowlessar 2025-08-13 11:31:48 +01:00
parent a5cd20c681
commit b73525e571

View file

@ -791,12 +791,13 @@ def optimise_with_funding_paths(input_measures, budget=None, target_gain=None, s
# Heating controls are only eligible if installed as part of a heating upgrade and so we do not include them
# here
allowed_types = WALL_INSULATION_MEASURES + ROOF_INSULATION_MEASURES + ECO4_ELIGIBILE_FABRIC_MEASURES
funding_paths = [{'AND': [], 'reference': 'fabric-only:eco4'}] + funding_paths
funding_paths = [{'reference': 'fabric-only:eco4'}] + funding_paths
solutions = []
for path_spec in funding_paths:
if path_spec["reference"] == "fabric-only:eco4":
# ECO4 fabric only path = special case
if isinstance(path_spec, dict) and path_spec.get("reference") == "fabric-only:eco4":
sub_measures = _filter_measures_by_types(input_measures, allowed_types)
if not sub_measures:
continue
@ -881,6 +882,9 @@ def optimise_with_funding_paths(input_measures, budget=None, target_gain=None, s
solutions = pd.DataFrame(solutions)
# Given the scheme, we now check if the packages are eligible. If they *are* eligible, but they don't meet the
# final upgrade target, we then look to perform a final optimisation pass to meet the target gain.
return solutions