debugging fuel types and a zero floor area property

This commit is contained in:
Khalim Conn-Kowlessar 2025-11-28 17:02:32 +00:00
parent c1a262830c
commit 1e9aa98ffc
2 changed files with 12 additions and 1 deletions

View file

@ -1212,9 +1212,17 @@ class Property:
else:
self.heating_energy_source = ['Wood Logs']
if len(self.heating_energy_source) == 0 or len(self.heating_energy_source) > 1:
if len(self.heating_energy_source) == 0 or (
len(self.heating_energy_source) > 1 and "Varied (Community Scheme)" not in self.heating_energy_source
):
# We might have something like heating energy source equal to ['Natural Gas', 'Varied (Community Scheme)']
# so we treat this as community heating
raise Exception("Investigate me")
if len(self.heating_energy_source) > 1:
# We treat this as a community scheme
self.heating_energy_source = ["Varied (Community Scheme)"]
self.heating_energy_source = self.heating_energy_source[0]
if self.heating_energy_source == "Varied (Community Scheme)":

View file

@ -596,6 +596,9 @@ class EPCRecord:
if not self.prepared_epc:
raise ValueError("EPC Recrod doesn not contain epc data")
if self.prepared_epc["total-floor-area"] is None:
return
self.prepared_epc["total-floor-area"] = float(
self.prepared_epc["total-floor-area"]
)