handle bug with park hoems

This commit is contained in:
Khalim Conn-Kowlessar 2024-01-03 12:08:41 +00:00
parent 97a7aadcf7
commit 98e6265b5d

View file

@ -431,7 +431,7 @@ class SearchEpc:
"Flat": "flat",
"House": "house",
"Maisonette": "maisonette",
"Park Home": "park home",
"Park home": "park home",
}
postcode = initial_postcode
@ -489,12 +489,17 @@ class SearchEpc:
# We handle some edge cases experiences with maisonettes - if built form is detatched, just filter
# on maisonette
# We also add some additional logic for bungalows, because they are far less common than other
# We also add some additional logic for Park homes, because they are far less common than other
# property types
if (estimation_property_type == "Maisonette") & (
estimation_built_form in ["Detached", "Semi-Detached"]
):
epc_data = epc_data[epc_data["property-type"] == estimation_property_type]
elif (estimation_property_type == "Park home") & (
sum(epc_data["built-form"] == estimation_built_form) == 0
):
epc_data = epc_data[epc_data["property-type"] == estimation_property_type]
else:
epc_data = epc_data[
(epc_data["built-form"] == estimation_built_form) & (