built and added condition of insulation, prior to ventilation

This commit is contained in:
Khalim Conn-Kowlessar 2023-12-18 15:17:22 +00:00
parent 9490fd0005
commit d38e4d44a0
6 changed files with 35 additions and 8 deletions

2
.idea/Model.iml generated
View file

@ -7,7 +7,7 @@
<sourceFolder url="file://$MODULE_DIR$/open_uprn" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/open_uprn" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/recommendations" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/recommendations" isTestSource="false" />
</content> </content>
<orderEntry type="jdk" jdkName="ha_15_32_eligibility" jdkType="Python SDK" /> <orderEntry type="jdk" jdkName="Python 3.10 (backend)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
</component> </component>
<component name="PyNamespacePackagesService"> <component name="PyNamespacePackagesService">

2
.idea/misc.xml generated
View file

@ -3,7 +3,7 @@
<component name="Black"> <component name="Black">
<option name="sdkName" value="Python 3.10 (backend)" /> <option name="sdkName" value="Python 3.10 (backend)" />
</component> </component>
<component name="ProjectRootManager" version="2" project-jdk-name="ha_15_32_eligibility" project-jdk-type="Python SDK" /> <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (backend)" project-jdk-type="Python SDK" />
<component name="PythonCompatibilityInspectionAdvertiser"> <component name="PythonCompatibilityInspectionAdvertiser">
<option name="version" value="3" /> <option name="version" value="3" />
</component> </component>

View file

@ -1,6 +1,8 @@
from datetime import datetime from datetime import datetime
import re import re
import os import os
import numpy as np
import pandas as pd import pandas as pd
from etl.epc.DataProcessor import DataProcessor from etl.epc.DataProcessor import DataProcessor
@ -820,7 +822,25 @@ class Property(Definitions):
""" """
if self.data["fixed-lighting-outlets-count"] == "": if self.data["fixed-lighting-outlets-count"] == "":
self.number_lighting_outlets = round(cleaned_property_data["FIXED_LIGHTING_OUTLETS_COUNT"].values[0])
# We check old EPCs and the full SAP EPC
lighting_data = []
if len(self.old_data):
lighting_data.extend([
int(x["fixed-lighting-outlets-count"]) for x in self.old_data if
x["fixed-lighting-outlets-count"] != ""
])
if len(self.full_sap_epc):
if self.full_sap_epc["fixed-lighting-outlets-count"] != "":
lighting_data.append(int(self.full_sap_epc["fixed-lighting-outlets-count"]))
if lighting_data:
self.number_lighting_outlets = round(np.median(lighting_data))
else:
self.number_lighting_outlets = round(cleaned_property_data["FIXED_LIGHTING_OUTLETS_COUNT"].values[0])
else: else:
self.number_lighting_outlets = float(self.data["fixed-lighting-outlets-count"]) self.number_lighting_outlets = float(self.data["fixed-lighting-outlets-count"])

View file

@ -478,9 +478,13 @@ async def trigger_plan(body: PlanTriggerRequest):
recommendations[property_id] = property_recommendations recommendations[property_id] = property_recommendations
# For expected adjust energy, we don't include mechanical ventilation so we'll add it back on # For expected adjust energy, we don't include mechanical ventilation so we'll add it back on
expected_adjusted_energy = expected_adjusted_energy + representative_rec_data[ mechanical_ventilation_rec = representative_rec_data[
representative_rec_data["type"] == "mechanical_ventilation" representative_rec_data["type"] == "mechanical_ventilation"
]["heat_demand"].values[0] ]
if not mechanical_ventilation_rec.empty:
expected_adjusted_energy = (
expected_adjusted_energy + mechanical_ventilation_rec["heat_demand"].values[0]
)
property_instance.set_adjusted_energy( property_instance.set_adjusted_energy(
current_adjusted_energy=current_adjusted_energy, current_adjusted_energy=current_adjusted_energy,

View file

@ -19,6 +19,7 @@ class PropertyValuation:
100070505235: 344000, # Based on Zoopla's estimation of 131 School road, which is also semi-detached 100070505235: 344000, # Based on Zoopla's estimation of 131 School road, which is also semi-detached
100070513306: 182000, # Based on Zoopla's estimation of 61 Simmons Drive 100070513306: 182000, # Based on Zoopla's estimation of 61 Simmons Drive
100071306896: 77000, # Based on Flat 2 of 44 Wedgewood Road on Zoopla 100071306896: 77000, # Based on Flat 2 of 44 Wedgewood Road on Zoopla
100021192109: 650000 # Based on Zoopla
} }
# We base our valuation uplifts on a number of sources # We base our valuation uplifts on a number of sources

View file

@ -61,9 +61,11 @@ class Recommendations:
property_recommendations.append(self.roof_recommender.recommendations) property_recommendations.append(self.roof_recommender.recommendations)
# Ventilation recommendations # Ventilation recommendations
self.ventilation_recomender.recommend() # We only produce a ventilation recommendation if the property is recommended to have wall or roof insulation
if self.ventilation_recomender.recommendation: if self.wall_recomender.recommendations or self.roof_recommender.recommendations:
property_recommendations.append(self.ventilation_recomender.recommendation) self.ventilation_recomender.recommend()
if self.ventilation_recomender.recommendation:
property_recommendations.append(self.ventilation_recomender.recommendation)
# Fireplace sealing recommendations # Fireplace sealing recommendations
self.fireplace_recommender.recommend() self.fireplace_recommender.recommend()