mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Added logic for already highly performant floors
This commit is contained in:
parent
2b13d38b60
commit
f3b24bfcd5
2 changed files with 22 additions and 7 deletions
|
|
@ -123,10 +123,10 @@ def handler():
|
||||||
[{"address1": p.address1, **p.floor} for p in input_properties]
|
[{"address1": p.address1, **p.floor} for p in input_properties]
|
||||||
)
|
)
|
||||||
|
|
||||||
input_properties[2].data["address1"]
|
input_properties[3].data["address1"]
|
||||||
input_properties[2].data["postcode"]
|
input_properties[3].data["postcode"]
|
||||||
floors_df["address1"].values[2]
|
floors_df["address1"].values[3]
|
||||||
floors_df["original_description"].values[2]
|
floors_df["original_description"].values[3]
|
||||||
|
|
||||||
df = pd.DataFrame(
|
df = pd.DataFrame(
|
||||||
[
|
[
|
||||||
|
|
@ -136,7 +136,7 @@ def handler():
|
||||||
df["property-type"].unique()
|
df["property-type"].unique()
|
||||||
|
|
||||||
from model_data.recommendations.FloorRecommendations import FloorRecommendations
|
from model_data.recommendations.FloorRecommendations import FloorRecommendations
|
||||||
self = FloorRecommendations(property_instance=input_properties[2], uvalue_estimates=uvalue_estimates)
|
self = FloorRecommendations(property_instance=input_properties[3], uvalue_estimates=uvalue_estimates)
|
||||||
|
|
||||||
# We need to deduce a U-value for "Good" energy effieciency
|
# We need to deduce a U-value for "Good" energy effieciency
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ class FloorRecommendations(BaseUtility):
|
||||||
"England and Wales": "England_Wales",
|
"England and Wales": "England_Wales",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PART_L_YEAR_CUTOFF = 2002
|
||||||
|
|
||||||
def __init__(self, property_instance: Property, uvalue_estimates: UvalueEstimations):
|
def __init__(self, property_instance: Property, uvalue_estimates: UvalueEstimations):
|
||||||
self.property = property_instance
|
self.property = property_instance
|
||||||
self.uvalue_estimates = uvalue_estimates
|
self.uvalue_estimates = uvalue_estimates
|
||||||
|
|
@ -144,12 +146,13 @@ class FloorRecommendations(BaseUtility):
|
||||||
return u
|
return u
|
||||||
|
|
||||||
def recommend(self):
|
def recommend(self):
|
||||||
|
u_value = self.property.floor["thermal_transmittance"]
|
||||||
is_suspended = self.property.floor["is_suspended"]
|
is_suspended = self.property.floor["is_suspended"]
|
||||||
insulation_thickness = self.property.floor["insulation_thickness"]
|
insulation_thickness = self.property.floor["insulation_thickness"]
|
||||||
|
|
||||||
# Check which floor the property is on
|
# Check which floor the property is on
|
||||||
|
|
||||||
self.property.year_built
|
year_built = self.property.year_built
|
||||||
self.property.data["floor-energy-eff"]
|
self.property.data["floor-energy-eff"]
|
||||||
self.property.data["floor-env-eff"]
|
self.property.data["floor-env-eff"]
|
||||||
|
|
||||||
|
|
@ -159,8 +162,20 @@ class FloorRecommendations(BaseUtility):
|
||||||
# If there's another property below, it's likely impractical to recommend a floor upgrade
|
# If there's another property below, it's likely impractical to recommend a floor upgrade
|
||||||
return
|
return
|
||||||
|
|
||||||
if is_suspended:
|
if u_value:
|
||||||
|
if self.property.data["property-type"] != "House":
|
||||||
|
raise NotImplementedError("Implement me")
|
||||||
|
|
||||||
|
# By being built more recently than this, it means that the property was likely build with soild
|
||||||
|
# concrete floors with insulation already
|
||||||
|
if year_built < self.PART_L_YEAR_CUTOFF:
|
||||||
|
raise NotImplementedError("Not investigated this use case")
|
||||||
|
|
||||||
|
if u_value <= self.BUILDING_REGULATIONS_PART_L_MAX_U_VALUE:
|
||||||
|
# The floor is already compliant
|
||||||
|
return
|
||||||
|
|
||||||
|
if is_suspended:
|
||||||
total_floor_area = float(self.property.data["total-floor-area"])
|
total_floor_area = float(self.property.data["total-floor-area"])
|
||||||
number_of_rooms = float(self.property.data["number-habitable-rooms"])
|
number_of_rooms = float(self.property.data["number-habitable-rooms"])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue