Open-EO / openeo-python-client

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

support "identity" callbacks #569

Open soxofaan opened 5 months ago

soxofaan commented 5 months 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 5 months ago

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

soxofaan commented 5 months ago

cc @VictorVerhaert