(geoms, include_z, interleaved)
| 291 | ) |
| 292 | @pytest.mark.parametrize("interleaved", [True, False]) |
| 293 | def 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 | |
| 310 | def test_transform_0dim(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…