mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
Merge pull request #502 from Hestia-Homes/funding-engine
added better logging on dupes and adding new types to material table
This commit is contained in:
commit
f20ba59320
3 changed files with 11 additions and 1 deletions
|
|
@ -578,6 +578,11 @@ class Funding:
|
|||
return pps.squeeze()["Cost Savings"]
|
||||
|
||||
if measure_type == "flat_roof_insulation":
|
||||
|
||||
# Not funding for properties starting at C or above
|
||||
if self.starting_sap_band in ["Low_C", "High_C", "Low_B", "High_B", "Low_A", "High_A"]:
|
||||
return 0
|
||||
|
||||
pps = filtered_pps_matrix[filtered_pps_matrix["Measure_Type"] == "FRI"]
|
||||
if pps.shape[0] != 1:
|
||||
raise ValueError("Invalid FRI category")
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ class MaterialType(enum.Enum):
|
|||
scaffolding = "scaffolding"
|
||||
high_heat_retention_storage_heaters = "high_heat_retention_storage_heaters"
|
||||
sealing_fireplace = "sealing_fireplace"
|
||||
roomstat_programmer_trvs = "roomstat_programmer_trvs"
|
||||
time_temperature_zone_control = "time_temperature_zone_control"
|
||||
|
||||
|
||||
class DepthUnit(enum.Enum):
|
||||
|
|
|
|||
|
|
@ -534,7 +534,10 @@ async def model_engine(body: PlanTriggerRequest):
|
|||
if input_uprns:
|
||||
# Check for dupes
|
||||
if len(input_uprns) != len(set(input_uprns)):
|
||||
raise ValueError("Duplicate UPRNs in the input data")
|
||||
# Find the duplicate UPRNs
|
||||
duplicates = set([x for x in input_uprns if input_uprns.count(x) > 1])
|
||||
# de-dupe input_uprns
|
||||
raise ValueError(f"Duplicate UPRNs in the input data: {duplicates}")
|
||||
|
||||
# If we have patches or overrides, we should read them in here
|
||||
patches, already_installed, non_invasive_recommendations, valuation_data = get_request_property_data(body)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue