Merge pull request #510 from Hestia-Homes/eco-eligiblity-bug

allow for no build form
This commit is contained in:
KhalimCK 2025-10-10 18:55:55 +01:00 committed by GitHub
commit 4f2798cdac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -484,12 +484,19 @@ async def model_engine(body: PlanTriggerRequest):
plan_input["uprn"] = np.where(plan_input["estimated"].isin([1, True]), None, plan_input["uprn"])
# We handle the landlord property type and built form
plan_input["property_type"] = plan_input["landlord_property_type"].copy()
plan_input["built_form"] = plan_input["landlord_built_form"].copy()
if "landlord_built_form" in plan_input.columns:
plan_input["built_form"] = plan_input["landlord_built_form"].copy()
else:
plan_input["built_form"] = None
plan_input["property_type"] = np.where(
plan_input["property_type"] == "unknown",
plan_input["epc_property_type"],
plan_input["property_type"]
)
if "epc_archetype" not in plan_input.columns:
plan_input["epc_archetype"] = None
plan_input["built_form"] = np.where(
plan_input["built_form"] == "unknown", plan_input["epc_archetype"], plan_input["built_form"]
)