mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
beginning to remove .data from property
This commit is contained in:
parent
f0a9c4340e
commit
6c89b07624
1 changed files with 19 additions and 29 deletions
|
|
@ -100,11 +100,8 @@ class Property:
|
|||
|
||||
self.address = address
|
||||
self.postcode = postcode
|
||||
self.data = {
|
||||
k.replace("_", "-"): v for k, v in epc_record.get("prepared_epc").items()
|
||||
}
|
||||
|
||||
self.old_data = epc_record.get("old_data")
|
||||
self.old_data = self.epc_record.get("old_data")
|
||||
self.property_dimensions = None
|
||||
# This is a list of measures that have already been installed in the property, typically found as a result
|
||||
# of the non-invasive surveys. We reflect that this has been installed in the recommendations, but remove the
|
||||
|
|
@ -125,13 +122,13 @@ class Property:
|
|||
self.valuation = property_valuation
|
||||
|
||||
self.uprn = uprn if uprn is not None else epc_record.get("uprn")
|
||||
self.uprn_source = self.data.get("uprn-source")
|
||||
self.uprn_source = self.epc_record.get("uprn-source")
|
||||
|
||||
self.full_sap_epc = epc_record.get("full_sap_epc")
|
||||
self.full_sap_epc = self.epc_record.get("full_sap_epc")
|
||||
self.in_conservation_area, self.is_listed, self.is_heritage = None, None, None
|
||||
self.restricted_measures = False
|
||||
self.year_built = epc_record.get("year_built")
|
||||
self.number_of_rooms = epc_record.prepared_epc.get("number_habitable_rooms")
|
||||
self.number_of_rooms = epc_record.get("number_habitable_rooms")
|
||||
self.age_band = epc_record.get("age_band")
|
||||
self.construction_age_band = epc_record.get("construction_age_band")
|
||||
self.number_of_floors = epc_record.get("number_of_floors")
|
||||
|
|
@ -158,37 +155,35 @@ class Property:
|
|||
"solar_pv": epc_record.get("photo_supply"),
|
||||
}
|
||||
self.solar_hot_water = {
|
||||
"solar_hot_water": epc_record.get("solar_water_heating_flag"),
|
||||
"solar_hot_water_boolean": epc_record.get("solar_water_heating_flag_bool"),
|
||||
"solar_hot_water": self.epc_record.get("solar_water_heating_flag"),
|
||||
"solar_hot_water_boolean": self.epc_record.get("solar_water_heating_flag_bool"),
|
||||
}
|
||||
self.wind_turbine = {
|
||||
"wind_turbine": epc_record.prepared_epc.get("wind_turbine_count"),
|
||||
"wind_turbine": self.epc_record.get("wind_turbine_count"),
|
||||
}
|
||||
self.number_of_open_fireplaces = {
|
||||
"number_of_open_fireplaces": epc_record.prepared_epc.get(
|
||||
"number_of_open_fireplaces": self.epc_record.get(
|
||||
"number_open_fireplaces"
|
||||
),
|
||||
}
|
||||
self.number_of_extensions = {
|
||||
"number_of_extensions": epc_record.prepared_epc.get("extension_count"),
|
||||
"number_of_extensions": self.epc_record.get("extension_count"),
|
||||
}
|
||||
self.number_of_storeys = {
|
||||
"number_of_storeys": epc_record.prepared_epc.get("flat_storey_count"),
|
||||
"number_of_storeys": self.epc_record.get("flat_storey_count"),
|
||||
}
|
||||
self.heat_loss_corridor = {
|
||||
"heat_loss_corridor": epc_record.prepared_epc.get("heat_loss_corridor"),
|
||||
"length": epc_record.prepared_epc.get("unheated_corridor_length"),
|
||||
"heat_loss_corridor_boolean": epc_record.get("heat_loss_corridor_bool"),
|
||||
"heat_loss_corridor": self.epc_record.get("heat_loss_corridor"),
|
||||
"length": self.epc_record.get("unheated_corridor_length"),
|
||||
"heat_loss_corridor_boolean": self.epc_record.get("heat_loss_corridor_bool"),
|
||||
}
|
||||
self.mains_gas = epc_record.prepared_epc.get("mains_gas_flag")
|
||||
self.floor_height = epc_record.prepared_epc.get("floor_height")
|
||||
self.mains_gas = self.epc_record.get("mains_gas_flag")
|
||||
self.floor_height = self.epc_record.get("floor_height")
|
||||
self.insulation_wall_area = None
|
||||
self.floor_area = epc_record.prepared_epc.get("total_floor_area")
|
||||
self.floor_area = self.epc_record.get("total_floor_area")
|
||||
self.roof_area = None
|
||||
self.insulation_floor_area = None
|
||||
self.number_lighting_outlets = epc_record.prepared_epc.get(
|
||||
"fixed_lighting_outlets_count"
|
||||
)
|
||||
self.number_lighting_outlets = self.epc_record.get("fixed_lighting_outlets_count")
|
||||
self.floor_level = None
|
||||
self.number_of_windows = None
|
||||
self.windows_area = None
|
||||
|
|
@ -217,13 +212,8 @@ class Property:
|
|||
# Store inspections
|
||||
self.inspections = inspections
|
||||
|
||||
# TODO: We keep this but only temporarily until we add bathrooms, bedrooms, building id to the condition data
|
||||
self.parse_kwargs(kwargs)
|
||||
|
||||
# Funding
|
||||
# self.gbis_eligibiltiy = None
|
||||
# self.eco4_eligibility = None
|
||||
# self.whlg_eligibility = None
|
||||
self.scheme = None
|
||||
self.funded_measures = None
|
||||
self.project_funding = None
|
||||
|
|
@ -420,7 +410,7 @@ class Property:
|
|||
|
||||
self.recommendations_scoring_data.append(scoring_dict)
|
||||
|
||||
simulation_epc = self.epc_record.prepared_epc.copy()
|
||||
simulation_epc = self.epc_record.__dict__.copy()
|
||||
# Insert static values
|
||||
simulation_epc["lodgement_date"] = simulation_lodgment_date
|
||||
simulation_epc = {k.replace("_", "-"): v for k, v in simulation_epc.items()}
|
||||
|
|
@ -1300,7 +1290,7 @@ class Property:
|
|||
'mechanical, supply and extract'
|
||||
]
|
||||
|
||||
return self.data.get("mechanical-ventilation") in ventilation_descriptions
|
||||
return self.epc_record.get("mechanical-ventilation") in ventilation_descriptions
|
||||
|
||||
@property
|
||||
def epc_is_expired(self) -> bool:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue