Added logic for already highly performant floors

This commit is contained in:
Khalim Conn-Kowlessar 2023-06-26 17:01:19 +01:00
parent 2b13d38b60
commit f3b24bfcd5
2 changed files with 22 additions and 7 deletions

View file

@ -123,10 +123,10 @@ def handler():
[{"address1": p.address1, **p.floor} for p in input_properties]
)
input_properties[2].data["address1"]
input_properties[2].data["postcode"]
floors_df["address1"].values[2]
floors_df["original_description"].values[2]
input_properties[3].data["address1"]
input_properties[3].data["postcode"]
floors_df["address1"].values[3]
floors_df["original_description"].values[3]
df = pd.DataFrame(
[
@ -136,7 +136,7 @@ def handler():
df["property-type"].unique()
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

View file

@ -60,6 +60,8 @@ class FloorRecommendations(BaseUtility):
"England and Wales": "England_Wales",
}
PART_L_YEAR_CUTOFF = 2002
def __init__(self, property_instance: Property, uvalue_estimates: UvalueEstimations):
self.property = property_instance
self.uvalue_estimates = uvalue_estimates
@ -144,12 +146,13 @@ class FloorRecommendations(BaseUtility):
return u
def recommend(self):
u_value = self.property.floor["thermal_transmittance"]
is_suspended = self.property.floor["is_suspended"]
insulation_thickness = self.property.floor["insulation_thickness"]
# 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-env-eff"]
@ -159,8 +162,20 @@ class FloorRecommendations(BaseUtility):
# If there's another property below, it's likely impractical to recommend a floor upgrade
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"])
number_of_rooms = float(self.property.data["number-habitable-rooms"])