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

Annotate DataCube methods with related openEO processes

Open
#236 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api compliancy documentation feature request
Dominant language
Python
Stars
217
Forks
56
Avg merge
1d 22h
Merged PRs (30d)
2

Description

The openEO python client works with predefined/hardcoded DataCube methods that implement certain openEO processes (unlike some other openEO clients (JS, R), that dynamically map function/method calls to openEO processes.
This is an intentional choice with a couple of advantages:

  • finetune a Pythonic interface, with helpful automatic conversions/adapters where useful
  • user can use their standard development helper tools (code completion, code intelligence, code navigation, type hint checkers, linters, documentation popups, ...)

(on top of that, we still can add dynamic process calls, e.g. see https://github.com/Open-EO/openeo-python-client/issues/40)

While it is in most cases obvious to how the DataCube methods and openEO processes are linked, I think it can be useful to make this link explicitly available in a programmatic way:
e.g. add annotation to each DataCube method pointing to the related openEO process(es)

class DataCube:

    @openeo_process("mask")
    def mask(self, mask: 'DataCube' = None, replacement=None) -> 'DataCube':

This would be useful for documentation of the python client:

  • in Sphinx doc generation: automatically add links to openEO process docs, and other enrichments: e.g. copy process categories
  • check where method doc blocks are out of sync with official documentation (e.g. description or parameters)

Other places where it can help:

  • automatically list which openEO processes are not covered (yet)
  • automatically support "dynamic" methods for processes if no hardcoded/predefined method is available
  • help with automatic argument conversion, e.g. "callable" to child graph conversion (https://github.com/Open-EO/openeo-python-client/issues/232)

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 locating the Python client's DataCube method definitions and reviewing how predefined methods map to openEO processes, using the mask example in the issue as a reference. The work is done when each applicable DataCube method exposes an explicit related-process annotation that can support documentation and coverage tooling.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.