Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate DataCube methods with related openEO processes #236

Open
soxofaan opened this issue Sep 13, 2021 · 1 comment
Open

Annotate DataCube methods with related openEO processes #236

soxofaan opened this issue Sep 13, 2021 · 1 comment

Comments

@soxofaan
Copy link
Member

soxofaan commented Sep 13, 2021

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 #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 (Auto-conversions in the generic DataCube.process method #232)
soxofaan added a commit that referenced this issue Mar 22, 2022
… openeo proces(ses)

For now, just a "see also" link to openeo.org is added to documentation
@soxofaan
Copy link
Member Author

soxofaan commented Mar 22, 2022

15295dd adds:

  • in Sphinx doc generation: automatically add links to openEO process docs,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant