Skip to content

List the supported UDF signatures in the documentation - #981

Open
sandeshbagmare wants to merge 1 commit into
Open-EO:masterfrom
sandeshbagmare:docs/udf-signature-reference
Open

sandeshbagmare wants to merge 1 commit into
Open-EO:masterfrom
sandeshbagmare:docs/udf-signature-reference

Conversation

@sandeshbagmare

Copy link
Copy Markdown

Fixes #534

The UDF page deferred to openeo.udf.udf_signatures through automodule, and that module cannot show both apply_datacube forms: it defines the xarray.DataArray variant second, so it shadows the deprecated XarrayDataCube one. Only the array form was ever rendered, which is why writing the choice as Union[...] looked like the only way out.

Proposed Changes

  • Replace the automodule block with the supported entrypoints written out: apply_datacube in both forms, apply_timeseries, apply_vectorcube, apply_metadata and apply_udf_data. Each comes with the annotations a UDF has to write and a line on when to use it.
  • Note that the XarrayDataCube form of apply_datacube is deprecated since 0.26.0 in favour of the xarray.DataArray form, and keep the existing warning on apply_metadata.
  • Add a comment in udf_signatures.py explaining why the deprecated stub is shadowed, so the module does not read as if the form had been dropped.

The module stays as the source of executable stubs, and the page now says so at the end of the section.

Verification

python -m sphinx -b dummy docs docs/_build reports no warnings for docs/udf.rst, and pytest tests/udf passes (122 passed, 6 skipped).

The UDF page deferred to the openeo.udf.udf_signatures module through
automodule, which cannot show both apply_datacube forms: the module defines the
xarray.DataArray variant second, so it shadows the deprecated XarrayDataCube
one and only the array form was ever rendered.

Spell out every supported entrypoint in the UDF page instead, with the
annotations a UDF has to write, note that the XarrayDataCube form is
deprecated since 0.26.0 in favour of the data array form, and point at the
module for the executable stubs that remain.

Fixes Open-EO#534

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Replacing autodoc directives with plain text and code blocks removes module and function targets, breaking existing cross-references and an inbound anchor; preserve these targets while retaining both explicit examples.

1 open issue
What changed in this PR

This PR addresses #534 by documenting UDF entrypoint signatures explicitly, so users can see both apply_datacube forms rather than only the last-defined Python stub.

Changes:

  • Replace generated module documentation with annotated examples and usage guidance for supported entrypoints.
  • Mark the XarrayDataCube form as deprecated while retaining the apply_metadata warning.
  • Add a comment explaining why the deprecated stub is shadowed; executable behavior is unchanged.
File Description
openeo/​udf/​udf_signatures.py Add a comment explaining the shadowed deprecated stub.
docs/​udf.rst Explicitly document supported signatures, usage guidance, and deprecation status.

Review effort: Balanced

Comment thread docs/udf.rst
Comment on lines +176 to +177
Supported signatures
--------------------
@soxofaan

Copy link
Copy Markdown
Member

Can you share a screenshot of how this looks?

This PR also introduces duplication of documentation (between docs/udf.rst and openeo/udf/udf_signatures.py). The cases that are added to docs/udf.rst should be removed from openeo/udf/udf_signatures.py I think to eliminate the duplication

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update UDF signature docs for apply_datacube also supporting xarray.DataArray

4 participants