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

Function test_transform

shapely/tests/test_coordinates.py:293–307  ·  view source on GitHub ↗
(geoms, include_z, interleaved)

Source from the content-addressed store, hash-verified

291)
292@pytest.mark.parametrize("interleaved", [True, False])
293def test_transform(geoms, include_z, interleaved):
294 geoms = np.array(geoms, np.object_)
295 coordinates_before = get_coordinates(geoms, include_z=include_z)
296 if interleaved:
297 transformation = lambda coords: coords + 1
298 elif not include_z:
299 transformation = lambda x, y: (x + 1, y + 1)
300 else:
301 transformation = lambda x, y, z: (x + 1, y + 1, z + 1)
302 new_geoms = transform(
303 geoms, transformation, include_z=include_z, interleaved=interleaved
304 )
305 assert new_geoms is not geoms
306 coordinates_after = get_coordinates(new_geoms, include_z=include_z)
307 assert_allclose(coordinates_before + 1, coordinates_after, equal_nan=True)
308
309
310def test_transform_0dim():

Callers

nothing calls this directly

Calls 2

get_coordinatesFunction · 0.90
transformFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…