def test_reduce_dimension_bandmath_lambda(con100): from openeo.processes import array_element im = con100.load_collection("S2") res = im.reduce_dimension(reducer=lambda data: array_element(data, index=1) + array_element(data, index=2), dimension='bands') assert res.graph == load_json_resource( 'data/1.0.0/reduce_dimension_bandmath.json')
def test_apply_dimension_bandmath_lambda(con100): from openeo.processes import array_element im = con100.load_collection("S2") res = im.apply_dimension(process=lambda d: array_element(d, index=1) + array_element(d, index=2), dimension="bands") assert res.graph == load_json_resource( 'data/1.0.0/apply_dimension_bandmath.json')