.
This commit is contained in:
parent
909e241907
commit
1ee796b282
29 changed files with 250 additions and 126 deletions
|
|
@ -92,7 +92,7 @@ def test_custom_radius(pois):
|
|||
}
|
||||
)
|
||||
|
||||
# 0.01 km = 10m — only the POI at the exact same location should match
|
||||
# 0.01 km = 10m: only the POI at the exact same location should match
|
||||
result = count_pois_per_postcode(postcodes, pois, groups=POI_GROUPS, radius_km=0.01)
|
||||
# The Restaurant at (51.5074, -0.1278) is at distance 0
|
||||
assert result["restaurants_0km"][0] >= 1
|
||||
|
|
@ -135,9 +135,9 @@ def test_min_distance_finds_nearest(postcodes, pois):
|
|||
assert len(result) == 2
|
||||
|
||||
ec1a = result.filter(pl.col("postcode") == "EC1A 1BB")
|
||||
# Rail station is at (51.5073, -0.1277), postcode at (51.5074, -0.1278) — very close
|
||||
# Rail station is at (51.5073, -0.1277), postcode at (51.5074, -0.1278), very close
|
||||
assert ec1a["train_tube_nearest_km"][0] < 0.05 # within 50m
|
||||
# Restaurant is co-located — distance ~0
|
||||
# Restaurant is co-located: distance ~0
|
||||
assert ec1a["restaurants_nearest_km"][0] < 0.01
|
||||
|
||||
# Far-away postcode should still get the global nearest distance.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue