From 070d7d332c85e21fdf3588c245935f8ac52d02b3 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 14 Nov 2025 22:51:45 +0000 Subject: [PATCH] added backup handling for another fuel edge case --- recommendations/Recommendations.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/recommendations/Recommendations.py b/recommendations/Recommendations.py index cc5b7895..bcb697fc 100644 --- a/recommendations/Recommendations.py +++ b/recommendations/Recommendations.py @@ -691,7 +691,25 @@ class Recommendations: "heating_cop": 1, "hotwater_cop": 1 } - raise NotImplementedError("Handle this case") + if main_fuel_description in ['biogas (community)']: + return { + "heating_fuel_type": "Smokeless Fuel", + "hotwater_fuel_type": "Smokeless Fuel", + "heating_cop": 0.85, + "hotwater_cop": 0.85 + } + logger.warning( + "Unhandled community fuel." + f"Fuel: {main_fuel_description}" + f"Heating: {heating_description}" + f"Heating: {hotwater_description}" + ) + return { + "heating_fuel_type": "Unmapped", + "hotwater_fuel_type": "Unmapped", + "heating_cop": 0.9, + "hotwater_cop": 0.9 + } mapped = descriptions_to_fuel_types.get(heating_description, None) if mapped is None: