Open-EO / openeo-python-driver

Common parts of a Python driver implementation for OpenEO
Apache License 2.0
11 stars 5 forks source link

Inconsistency between namespace usage in `describe_process` and `datacube_from_process` for UDP #159

Open JanssenBrm opened 1 year ago

JanssenBrm commented 1 year ago

There is a difference in using the usage of namespaces for UDPs in different functions within the python client. The examples below show the different functions for a service called Emergence_detection_V2022_TERRA, created by user u:5e15639083f8407aaf106d87fd5bc26738619baf2bdc48bece79b1225ffbcaee@egi.eu.

When you want to use the describe_process function, the namespace should be set to u:<userid> as shown below. The code gives an error when using the full public URL.

service = "Emergence_detection_V2022_TERRA"
namespace = "u:5e15639083f8407aaf106d87fd5bc26738619baf2bdc48bece79b1225ffbcaee@egi.eu"

# Working function call
eoconn.describe_process(service, namespace=namespace)

# Returns an error
eoconn.describe_process(service, namespace=f'https://openeo.vito.be/openeo/1.1/processes/{namespace}/{service}')

However, when you want to use the datacube_from_process function to execute the actual service, you need to specify the namespace as <backend>/u:<userid>/<service>:


# Working function call
eoconn.datacube_from_process(service, namespace=f'https://openeo.vito.be/openeo/1.1/processes/{namespace}/{service}', date=date , polygon=aoi)

# Returns an error when executing the resulting datacube
eoconn.datacube_from_process(service, namespace=namespace, date=date , polygon=aoi)
soxofaan commented 1 year ago

good point.

However note that user based namespaces are a bit of an experimental feature in VITO back-end. The first issue with describe_process is a client issue, but I think the working approach is the right one. The second issue with datacube_from_process is a driver issue I guess, which we can address I think