Open-EO / openeo-python-client

Python client API for OpenEO
https://open-eo.github.io/openeo-python-client/
Apache License 2.0
143 stars 36 forks source link

support "identy" callbacks #569

Open soxofaan opened 3 weeks ago

soxofaan commented 3 weeks ago
from openeo.internal.processes.builder import convert_callable_to_pgnode

convert_callable_to_pgnode(lambda x: x + 1).flat_graph()
# -> {'add1': {'process_id': 'add',  'arguments': {'x': {'from_parameter': 'x'}, 'y': 1},  'result': True}}

convert_callable_to_pgnode(lambda x: x).flat_graph()
# ->  'dict' object has no attribute 'flat_graph'
soxofaan commented 3 weeks ago

constant could be used as "identity" function, see https://github.com/Open-EO/openeo-processes/issues/275

soxofaan commented 3 weeks ago

cc @VictorVerhaert