mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Addde ValueError on missing impact measure
This commit is contained in:
parent
5d54226378
commit
f4e0528aa0
1 changed files with 3 additions and 2 deletions
|
|
@ -46,7 +46,8 @@ class Recommendations:
|
|||
rec["co2_equivalent_savings"] = float(property_instance.data["co2-emissions-current"]) - new_carbon
|
||||
rec["heat_demand"] = float(property_instance.data["co2-emissions-current"]) - new_heat_demand
|
||||
|
||||
if rec["sap_points"] is None:
|
||||
raise ValueError("Sap points missing")
|
||||
if (rec["sap_points"] is None) and (rec["co2_equivalent_savings"] is None) or (
|
||||
rec["heat_demand"] is None):
|
||||
raise ValueError("sap points, co2 or heat demand is missing")
|
||||
|
||||
return property_recommendations
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue