@@ -188,20 +188,20 @@ def test_from_geodataframe_default(self, gdf):
188
188
}
189
189
)
190
190
cube = vc .get_cube ()
191
- assert cube .dims == ("geometries" , "bands " )
191
+ assert cube .dims == ("geometries" , "properties " )
192
192
assert cube .shape == (2 , 1 )
193
- assert {k : list (v .values ) for k , v in cube .coords .items ()} == {"geometries" : [0 , 1 ], "bands " : ["pop" ]}
193
+ assert {k : list (v .values ) for k , v in cube .coords .items ()} == {"geometries" : [0 , 1 ], "properties " : ["pop" ]}
194
194
195
195
@pytest .mark .parametrize (
196
196
["columns_for_cube" , "expected" ],
197
197
[
198
- ("numerical" , {"shape" : (2 , 1 ), "coords" : {"geometries" : [0 , 1 ], "bands " : ["pop" ]}}),
199
- ("all" , {"shape" : (2 , 2 ), "coords" : {"geometries" : [0 , 1 ], "bands " : ["id" , "pop" ]}}),
198
+ ("numerical" , {"shape" : (2 , 1 ), "coords" : {"geometries" : [0 , 1 ], "properties " : ["pop" ]}}),
199
+ ("all" , {"shape" : (2 , 2 ), "coords" : {"geometries" : [0 , 1 ], "properties " : ["id" , "pop" ]}}),
200
200
([], None ),
201
- (["id" ], {"shape" : (2 , 1 ), "coords" : {"geometries" : [0 , 1 ], "bands " : ["id" ]}}),
202
- (["pop" , "id" ], {"shape" : (2 , 2 ), "coords" : {"geometries" : [0 , 1 ], "bands " : ["pop" , "id" ]}}),
201
+ (["id" ], {"shape" : (2 , 1 ), "coords" : {"geometries" : [0 , 1 ], "properties " : ["id" ]}}),
202
+ (["pop" , "id" ], {"shape" : (2 , 2 ), "coords" : {"geometries" : [0 , 1 ], "properties " : ["pop" , "id" ]}}),
203
203
# TODO: test specifying non-existent column (to be filled with no-data):
204
- # (["pop", "nopenope"], {"shape": (2, 2), "coords": {"geometries": [0, 1], "bands ": ["pop", "nopenope"]}}),
204
+ # (["pop", "nopenope"], {"shape": (2, 2), "coords": {"geometries": [0, 1], "properties ": ["pop", "nopenope"]}}),
205
205
],
206
206
)
207
207
def test_from_geodataframe_columns_for_cube (self , gdf , columns_for_cube , expected ):
@@ -237,7 +237,7 @@ def test_from_geodataframe_columns_for_cube(self, gdf, columns_for_cube, expecte
237
237
if expected is None :
238
238
assert cube is None
239
239
else :
240
- assert cube .dims == ("geometries" , "bands " )
240
+ assert cube .dims == ("geometries" , "properties " )
241
241
assert cube .shape == expected ["shape" ]
242
242
assert {k : list (v .values ) for k , v in cube .coords .items ()} == expected ["coords" ]
243
243
@@ -571,7 +571,9 @@ def test_buffer_points(self):
571
571
}
572
572
)
573
573
574
- def test_apply_dimension_run_udf_change_geometry (self , vc , backend_implementation ):
574
+ @pytest .mark .parametrize ("dimension" , ["bands" , "properties" ])
575
+ def test_apply_dimension_run_udf_change_geometry (self , gdf , backend_implementation , dimension ):
576
+ vc = DriverVectorCube .from_geodataframe (gdf , dimension_name = dimension )
575
577
udf = textwrap .dedent (
576
578
"""
577
579
from openeo.udf import UdfData, FeatureCollection
@@ -592,7 +594,7 @@ def process_geometries(udf_data: UdfData) -> UdfData:
592
594
}
593
595
}
594
596
env = EvalEnv ({"backend_implementation" : backend_implementation })
595
- result = vc .apply_dimension (process = callback , dimension = "bands" , env = env )
597
+ result = vc .apply_dimension (process = callback , dimension = dimension , env = env )
596
598
assert isinstance (result , DriverVectorCube )
597
599
feature_collection = result .to_geojson ()
598
600
assert feature_collection == DictSubSet (
0 commit comments