mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
finished adding measure_type to recommendations and added check to ensure it's populated
This commit is contained in:
parent
feb60537c0
commit
79746e9a36
4 changed files with 11 additions and 3 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue