diff --git a/backend/Funding.py b/backend/Funding.py index 3c30ba27..1a3b3b67 100644 --- a/backend/Funding.py +++ b/backend/Funding.py @@ -419,6 +419,21 @@ class Funding: ]: return 'Solid Fossil Room Heaters' + # Handle the case of no heating system - electric heaters assumed + if mainheating["has_no_system_present"] or mainheating["has_portable_electric_heaters"]: + return 'Electric Room Heaters' + + if not any(mainheating.values()): + # This means we have an unknown heating system like 'SAP05:Main-Heating' + return 'Electric Room Heaters' + + if mainheating["has_warm_air"] and main_fuel["fuel_type"] == "mains gas": + # Treat warm air gas system as a condensing gas boiler + if mainheat_energy_eff in ["Good", "Very Good"]: + return "Condensing Gas Boiler" + else: + return "Non Condensing Gas Boiler" + raise ValueError("Invalid pre heating system") def calculate_partial_project_abs( diff --git a/backend/tests/test_funding.py b/backend/tests/test_funding.py index 860dd120..9e46ea9e 100644 --- a/backend/tests/test_funding.py +++ b/backend/tests/test_funding.py @@ -1009,6 +1009,8 @@ from tqdm import tqdm from etl.epc_clean.epc_attributes.MainheatAttributes import MainHeatAttributes from etl.epc_clean.epc_attributes.MainFuelAttributes import MainFuelAttributes +# TODO: Add innovation uplift to private + mock_project_scores_matrix = mock_project_scores_matrix() mock_whlg_postcodes = mock_whlg_postcodes() mock_partial_scores_matrix = mock_partial_scores_matrix()