fixing bug with missing fuel type

This commit is contained in:
Khalim Conn-Kowlessar 2025-12-21 11:08:31 +08:00
parent 9c48bdfbd6
commit 5ed7836fde
2 changed files with 8 additions and 1 deletions

View file

@ -1296,6 +1296,13 @@ class Property:
else:
raise NotImplementedError(f"Unhandled fuel {self.main_fuel['fuel_type']}")
# We handle edge case where no heating system is indicated
if self.main_fuel["fuel_type"] in fuel_map:
mapped_fuel = fuel_map[self.main_fuel["fuel_type"]]
self.heating_energy_source = mapped_fuel
self.hot_water_energy_source = mapped_fuel
return
if len(self.heating_energy_source) > 1:
# We treat this as a community scheme
self.heating_energy_source = ["Varied (Community Scheme)"]

View file

@ -899,7 +899,7 @@ async def model_engine(body: PlanTriggerRequest):
# Insert the spatial data
logger.info("Getting spatial data")
input_properties = OpenUprnClient.set_spatial_data(input_properties, bucket_name=get_settings().DATA_BUCKET)
[p.set_features(cleaned=cleaned, kwh_client=kwh_client, kwh_predictions=kwh_preds) for p in input_properties]
logger.info("Performing solar analysis")