Open soxofaan opened 9 months ago
Triggered from discussing #533 with @VictorVerhaert : the docs on UDF signatures (https://open-eo.github.io/openeo-python-client/udf.html#module-openeo.udf.udf_signatures) should be updated to newly added xarray.DataArray support (#310)
xarray.DataArray
I wanted do it naively by introducing Union[XarrayDataCube, xarray.DataArray] in https://github.com/Open-EO/openeo-python-client/blob/7ce92925dd9544ff116b14c0339de203f854ec27/openeo/udf/udf_signatures.py#L30
Union[XarrayDataCube, xarray.DataArray]
but then realized that that is actually more confusing, as the user is not expected to use Union there.
The user should pick one of
def apply_datacube(cube: XarrayDataCube, context: dict) -> XarrayDataCube: #or def apply_datacube(cube: xarray.DataArray, context: dict) -> xarray.DataArray:
but defining it like that in udf_signatures.py is not going to work (first form will be overwritten by second).
udf_signatures.py
We probably have to port udf_signatures.py from a python file to a RestructuredText file in the docs
I want to bump this issue, since I stumbled over a similar unclarity on how UDF currently tackle working with the input data (automatic conversion if needed)
Triggered from discussing #533 with @VictorVerhaert : the docs on UDF signatures (https://open-eo.github.io/openeo-python-client/udf.html#module-openeo.udf.udf_signatures) should be updated to newly added
xarray.DataArray
support (#310)I wanted do it naively by introducing
Union[XarrayDataCube, xarray.DataArray]
in https://github.com/Open-EO/openeo-python-client/blob/7ce92925dd9544ff116b14c0339de203f854ec27/openeo/udf/udf_signatures.py#L30but then realized that that is actually more confusing, as the user is not expected to use Union there.
The user should pick one of
but defining it like that in
udf_signatures.py
is not going to work (first form will be overwritten by second).We probably have to port
udf_signatures.py
from a python file to a RestructuredText file in the docs