Open-EO / openeo-python-client

Python client API for OpenEO
https://open-eo.github.io/openeo-python-client/
Apache License 2.0
147 stars 38 forks source link

Annotate DataCube methods with related openEO processes #236

Open soxofaan opened 3 years ago

soxofaan commented 3 years ago

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:

(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:

Other places where it can help:

soxofaan commented 2 years ago

15295dd adds: