From 3ad3d7cf34cfeb1f91118357aeaf2557a31cb684 Mon Sep 17 00:00:00 2001 From: Jeroen Dries Date: Sat, 30 Nov 2019 19:27:11 +0100 Subject: [PATCH] improve docs to mention custom processes, so that custom process graphs can also be built #40 --- docs/conf.py | 1 + docs/index.rst | 23 +++++++++++++++++++++-- setup.py | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 92bb6a7e9..3b88549e6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,6 +36,7 @@ # ones. extensions = ['sphinx.ext.autodoc', 'sphinx_autodoc_annotation', + 'sphinx_autodoc_typehints', 'sphinx.ext.viewcode', 'sphinx.ext.doctest'] diff --git a/docs/index.rst b/docs/index.rst index 42741a493..3cf350818 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -120,6 +120,25 @@ after that, we can simply apply it along a dimension:: >>> smoothed_evi = evi_cube_masked.apply_dimension(smoothing_udf,runtime='Python') +Using custom processes +---------------------- +An openEO backend may offer processes that are not part of the core API, or the client may not yet +have a corresponding method for a process that you wish to use. In that case, you can fall back to +a more generic API that allows you to add processes directly. + +To add a simple process to the graph, use: :func:`~openeo.rest.imagecollectionclient.ImageCollectionClient#graph_add_process`. +This will return a new ImageCollection with the new process. + +Example:: + + >>> args= { + 'data': {'from_node': cube.node_id}, + 'param': 3.14 + } + cube.graph_add_process('my_process',args) + +To be able to use custom processes, you need to have some documentation. A list of processes can be +retrieved with: :func:`~openeo.rest.connection.Connection#list_processes`. API === @@ -138,10 +157,10 @@ use the lower level classes. openeo.rest.connection -------------------------- +---------------------- .. automodule:: openeo.rest.connection - :members: Connection OpenEoApiError + :members: Connection, OpenEoApiError openeo.rest.imagecollectionclient diff --git a/setup.py b/setup.py index 04dd94cc5..d4cd98d38 100644 --- a/setup.py +++ b/setup.py @@ -42,6 +42,7 @@ "dev": [ "sphinx", "sphinx-autodoc-annotation", + "sphinx-autodoc-typehints", "mock", "requests-mock", "pytest",