MCPcopy Create free account
hub / github.com/shapely/shapely / test_dwithin

Function test_dwithin

shapely/tests/test_predicates.py:239–251  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

237
238@pytest.mark.skipif(shapely.geos_version < (3, 10, 0), reason="GEOS < 3.10")
239def test_dwithin():
240 p1 = shapely.points(50, 4)
241 p2 = shapely.points(50.1, 4.1)
242 actual = shapely.dwithin([p1, p2, None], p1, distance=0.05)
243 np.testing.assert_equal(actual, [True, False, False])
244 assert actual.dtype == np.bool_
245 actual = shapely.dwithin([p1, p2, None], p1, distance=0.2)
246 np.testing.assert_allclose(actual, [True, True, False])
247 assert actual.dtype == np.bool_
248
249 # an array of distances
250 actual = shapely.dwithin(p1, p2, distance=[0.05, 0.2, np.nan])
251 np.testing.assert_allclose(actual, [False, True, False])
252
253
254@pytest.mark.parametrize("geometry", all_types)

Callers

nothing calls this directly

Calls 1

dwithinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…