Skip to content

Commit

Permalink
add error message if boundary_geography is not OA / MSOA
Browse files Browse the repository at this point in the history
  • Loading branch information
Hussein-Mahfouz committed Oct 7, 2024
1 parent 346a917 commit 5e47d0c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/acbm/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ def edit_boundary_resolution(
] # we always need MSOA21CD to filter to study area
print("keeping original OA boundaries")

else:
msg = f"Invalid geography: '{geography}'. Expected 'OA' or 'MSOA'."
raise ValueError(msg)

# Ensure all geometries are MultiPolygon
study_area["geometry"] = study_area["geometry"].apply(
lambda geom: MultiPolygon([geom]) if geom.geom_type == "Polygon" else geom
Expand Down

0 comments on commit 5e47d0c

Please sign in to comment.