mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
formatting epc data for storage
This commit is contained in:
parent
1b82993802
commit
90099edcb4
2 changed files with 21 additions and 3 deletions
|
|
@ -48,6 +48,7 @@ class Property(BaseUtility):
|
||||||
self.number_of_open_fireplaces = None
|
self.number_of_open_fireplaces = None
|
||||||
self.number_of_extensions = None
|
self.number_of_extensions = None
|
||||||
self.number_of_storeys = None
|
self.number_of_storeys = None
|
||||||
|
self.heat_loss_corridor = None
|
||||||
|
|
||||||
if epc_client:
|
if epc_client:
|
||||||
self.epc_client = epc_client
|
self.epc_client = epc_client
|
||||||
|
|
@ -282,6 +283,22 @@ class Property(BaseUtility):
|
||||||
# We don't know when the property was built
|
# We don't know when the property was built
|
||||||
self.year_built = None
|
self.year_built = None
|
||||||
|
|
||||||
|
def set_heat_loss_corridor(self):
|
||||||
|
"""
|
||||||
|
cleans the heat-loss-corridor
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
map = {
|
||||||
|
"no corridor": False,
|
||||||
|
"unheated corridor": True,
|
||||||
|
"heated corridor": False
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.data["heat-loss-corridor"] in self.DATA_ANOMALY_MATCHES:
|
||||||
|
self.heat_loss_corridor = False
|
||||||
|
else:
|
||||||
|
self.heat_loss_corridor = map[self.data["heat-loss-corridor"]]
|
||||||
|
|
||||||
def _clean_upload_data(self, to_update):
|
def _clean_upload_data(self, to_update):
|
||||||
for k, v in to_update.items():
|
for k, v in to_update.items():
|
||||||
if v in self.DATA_ANOMALY_MATCHES:
|
if v in self.DATA_ANOMALY_MATCHES:
|
||||||
|
|
@ -358,7 +375,7 @@ class Property(BaseUtility):
|
||||||
"number_of_extensions": self.number_of_extensions,
|
"number_of_extensions": self.number_of_extensions,
|
||||||
"number_of_storeys": self.number_of_storeys,
|
"number_of_storeys": self.number_of_storeys,
|
||||||
"mains_gas": self.data["mains-gas-flag"],
|
"mains_gas": self.data["mains-gas-flag"],
|
||||||
"energy_tarrif": self.data["energy-tariff"],
|
"energy_tariff": self.data["energy-tariff"],
|
||||||
"primary_energy_consumption": self.energy["primary_energy_consumption"],
|
"primary_energy_consumption": self.energy["primary_energy_consumption"],
|
||||||
"co2_emissions": self.energy["co2_emissions"],
|
"co2_emissions": self.energy["co2_emissions"],
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,12 +125,13 @@ class PropertyDetailsEpcModel(Base):
|
||||||
windows_rating = Column(Enum(FeatureRating, ))
|
windows_rating = Column(Enum(FeatureRating, ))
|
||||||
heating = Column(Text)
|
heating = Column(Text)
|
||||||
heating_rating = Column(Enum(FeatureRating, ))
|
heating_rating = Column(Enum(FeatureRating, ))
|
||||||
heating_contols = Column(Text)
|
heating_controls = Column(Text)
|
||||||
heating_contols_rating = Column(Enum(FeatureRating, ))
|
heating_controls_rating = Column(Enum(FeatureRating, ))
|
||||||
hot_water = Column(Text)
|
hot_water = Column(Text)
|
||||||
hot_water_rating = Column(Enum(FeatureRating, ))
|
hot_water_rating = Column(Enum(FeatureRating, ))
|
||||||
lighting = Column(Text)
|
lighting = Column(Text)
|
||||||
lighting_rating = Column(Enum(FeatureRating))
|
lighting_rating = Column(Enum(FeatureRating))
|
||||||
|
mainfuel = Column(Text)
|
||||||
ventilation = Column(Text)
|
ventilation = Column(Text)
|
||||||
solar_pv = Column(Text)
|
solar_pv = Column(Text)
|
||||||
solar_hot_water = Column(Text)
|
solar_hot_water = Column(Text)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue