Open-EO / Open-EO/openeo-python-client

Promote unit test based UDF development

Open
#552 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation feature request nice-to-have UDF usability
Dominant language
Python
Stars
217
Forks
56
Avg merge
1d 22h
Merged PRs (30d)
2

Description

Writing UDFs can be cumbersome when your development cycle involves submitting your process graph to a real openEO backend.

Local UDF processing shortens the development cycle, but that is typically done with throw away experiments.
Even better would be to leverage unit tests, e.g. with test functions directly included the UDF python file.

In the python client we could provide some helpers to generate dummy data.

e.g. something like


def apply_datacube(cube: XarrayDataCube, context: dict) -> XarrayDataCube:
    ...


def test_apply_datacube():
    cube = produce_dummy_data(..., desired bands, temporal resolution, ....)

    result = apply_datacube(cube)

    # check actual results against expectations

The user can then easily run the tests with something like pytest my_udf.py.

And maybe backends can even provide services to run the tests in their runtime environment

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Python client’s existing local UDF processing and testing support, then examine how a UDF file is executed with pytest. Define the dummy-data helper requirements for bands and temporal resolution, and clarify whether backend runtime test services are in scope. Done should include a documented way to run a UDF’s tests locally and verify the resulting data.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.