Skip to content

Commit a97c1ac

Browse files
committed
fixup! Remove legacy ImageCollection from DataCube class hierarchy (#100/#278 related)
1 parent 4efab2c commit a97c1ac

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

tests/rest/datacube/test_datacube.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ def test_filter_bands_index(s2cube, api_version):
192192
assert im.flat_graph() == expected
193193

194194

195-
def test_pipe(con040, api_version):
195+
def test_pipe(con040):
196196
def ndvi_percent(cube):
197197
return cube.ndvi().linear_scale_range(0, 1, 0, 100)
198198

199199
s2cube = con040.load_collection("S2")
200200
im = s2cube.pipe(ndvi_percent)
201-
assert im.flat_graph() == load_json_resource('data/{v}/pipe.json'.format(v=api_version))
201+
assert im.flat_graph() == load_json_resource('data/0.4.0/pipe.json')
202202

203203

204204
def test_filter_bbox_minimal(s2cube):

tests/rest/datacube/test_datacube100.py

-19
Original file line numberDiff line numberDiff line change
@@ -1424,25 +1424,6 @@ def validation(request, context):
14241424
assert m.call_count == 1
14251425

14261426

1427-
def test_pipe_with_args(con100):
1428-
def ndvi_scaled(cube, in_max=2, out_max=3):
1429-
return cube.ndvi().linear_scale_range(0, in_max, 0, out_max)
1430-
1431-
s2cube = con100.load_collection("S2")
1432-
im = s2cube.pipe(ndvi_scaled)
1433-
assert im.flat_graph()["apply1"]["arguments"]["process"]["process_graph"]["linearscalerange1"]["arguments"] == {
1434-
'inputMax': 2, 'inputMin': 0, 'outputMax': 3, 'outputMin': 0, 'x': {'from_parameter': 'x'}
1435-
}
1436-
im = s2cube.pipe(ndvi_scaled, 4, 5)
1437-
assert im.flat_graph()["apply1"]["arguments"]["process"]["process_graph"]["linearscalerange1"]["arguments"] == {
1438-
'inputMax': 4, 'inputMin': 0, 'outputMax': 5, 'outputMin': 0, 'x': {'from_parameter': 'x'}
1439-
}
1440-
im = s2cube.pipe(ndvi_scaled, out_max=7)
1441-
assert im.flat_graph()["apply1"]["arguments"]["process"]["process_graph"]["linearscalerange1"]["arguments"] == {
1442-
'inputMax': 2, 'inputMin': 0, 'outputMax': 7, 'outputMin': 0, 'x': {'from_parameter': 'x'}
1443-
}
1444-
1445-
14461427
def test_flatten_dimensions(con100):
14471428
s2 = con100.load_collection("S2")
14481429
cube = s2.flatten_dimensions(dimensions=["t", "bands"], target_dimension="features")

0 commit comments

Comments
 (0)