fixing assignment of package ref

This commit is contained in:
Khalim Conn-Kowlessar 2024-11-19 22:04:19 +00:00
parent 1645f9ab9e
commit 9057b3d4da

View file

@ -2126,8 +2126,16 @@ def propsed_wave_3_sample():
)
expected_epc = sap_to_epc(expected_sap)
archetype_data = archetype_data.sort_values("distance_meters", ascending=True)
# We take the features of the closest matching property
closest_match = archetype_data.sort_values("distance_meters", ascending=True).iloc[0]
closest_match = archetype_data.iloc[0]
# Set the package ref
if expected_epc in ["C", "B", "A"]:
package_ref = None
else:
package_ref = archetype_data["Package Ref"].dropna().values[0]
region_surveyed.append(
{
@ -2141,7 +2149,7 @@ def propsed_wave_3_sample():
'Survey: Primary Heating System': closest_match["Survey: Primary Heating System"],
"Survey: Matching Address ID": closest_match["Address ID"],
'Distance to Closest Match (m)': closest_match["distance_meters"],
"Package Ref": closest_match["Package Ref"],
"Package Ref": package_ref,
"Match Type": match_type
}
)