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

Eliminate wrong assumptions about "terminal" nodes #583

Open soxofaan opened 4 months ago

soxofaan commented 4 months ago

The process graph building logic in Python client quite heavily works from assumption about the equivalence

"end node" = "result node" = "save_result"

which works for most use cases, but that's not fully in line with full openEO API.

also see https://github.com/Open-EO/openeo-geopyspark-driver/issues/424#issuecomment-2199780221:

Some more insights from https://github.com/Open-EO/openeo-processes/issues/279 and https://github.com/Open-EO/openeo-api/issues/427 about different kinds of terminal nodes in the openEO API

  • a process graph can have multiple "end nodes": leaf nodes that are not input to another node
  • a process graph must have one "result node": node with "result": True.
    • The result node is actually just important in the the context of a "callback" (in a "parent" process like apply, reduce_dimension, ...) to determine the value that has to be used by the parent process
    • The "result" property has little meaning for "top-level" graphs
  • the result node does not have to be an "end node". Result nodes can be input to subsequent nodes
  • a "save_result" node neither has to be "end node" or "result node" to be executed
soxofaan commented 4 months ago

some related tickets

m-mohr commented 2 weeks ago

Just a short note regarding "The "result" property has little meaning for "top-level" graphs": This is only true when submitted for execution. If stored as a UDP, it actually has a meaning as it's the return value of the UDP.