finished adding measure_type to recommendations and added check to ensure it's populated

This commit is contained in:
Khalim Conn-Kowlessar 2024-10-03 10:59:40 +01:00
parent feb60537c0
commit 79746e9a36
4 changed files with 11 additions and 3 deletions

View file

@ -58,10 +58,9 @@ class HotwaterRecommendations:
self.recommendations.append(
{
"phase": phase,
"parts": [
# TODO
],
"parts": [],
"type": "hot_water_tank_insulation",
"measure_type": "hot_water_tank_insulation",
"description": description,
"starting_u_value": None,
"new_u_value": None,
@ -107,6 +106,7 @@ class HotwaterRecommendations:
"phase": phase,
"parts": [],
"type": "cylinder_thermostat",
"measure_type": "cylinder_thermostat",
"description": description,
"starting_u_value": None,
"new_u_value": None,

View file

@ -267,6 +267,11 @@ class Recommendations:
property_recommendations,
)
# Check to make sure measure_type is populated
for recs in property_recommendations:
if any(pd.isnull(rec.get("measure_type")) for rec in recs):
raise ValueError("Measure type is not populated")
return property_recommendations, property_representative_recommendations
@staticmethod

View file

@ -52,6 +52,7 @@ class SecondaryHeating:
"phase": phase,
"parts": [],
"type": "secondary_heating",
"measure_type": "secondary_heating",
"description": description,
"starting_u_value": None,
"new_u_value": None,

View file

@ -126,6 +126,7 @@ class SolarPvRecommendations:
"phase": phase,
"parts": [],
"type": "solar_pv",
"measure_type": "solar_pv",
"description": description,
"starting_u_value": None,
"new_u_value": None,
@ -221,6 +222,7 @@ class SolarPvRecommendations:
"phase": phase,
"parts": [],
"type": "solar_pv",
"measure_type": "solar_pv",
"description": description,
"starting_u_value": None,
"new_u_value": None,