Skip to content

Commit e35eb5b

Browse files
committed
Issue #720/#402/#725 document SaveResult design background a bit more
1 parent 3302d87 commit e35eb5b

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

docs/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Results
5454

5555
.. automodule:: openeo.rest.result
5656
:members:
57+
:inherited-members:
5758

5859
.. automodule:: openeo.rest.stac_resource
5960
:members:

openeo/rest/result.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,35 @@
33

44
class SaveResult(StacResource):
55
"""
6-
Alias for :py:class:`~openeo.rest.stac_resource.StacResource`,
7-
returned by methods corresponding to the openEO process ``save_result``, like
6+
Handle for a process graph that represents the return value
7+
of the openEO process ``save_result``,
8+
as returned by methods like
89
:py:meth:`DataCube.save_result() <openeo.rest.datacube.DataCube.save_result>`
9-
and :py:meth:`VectorCube.save_result() <openeo.rest.vectorcube.VectorCube.save_result>`
10+
and :py:meth:`VectorCube.save_result() <openeo.rest.vectorcube.VectorCube.save_result>`.
11+
12+
.. note ::
13+
This class is practically a just direct alias for
14+
:py:class:`~openeo.rest.stac_resource.StacResource`,
15+
but with a more self-explanatory name.
16+
17+
Moreover, this additional abstraction layer also acts somewhat as an adapter between
18+
the incompatible return values from the ``save_result`` process
19+
in different versions of the official openeo-processes definitions:
20+
21+
- in openeo-processes 1.x: ``save_result`` just returned a boolean,
22+
but that was not really useful to further build upon
23+
and was never properly exposed in the openEO Python client.
24+
- in openeo-processes 2.x: ``save_result`` returns a new concept:
25+
a "STAC resource" (object with subtype "stac")
26+
which is a more useful and flexible representation of an openEO result,
27+
allowing additional operations.
28+
29+
The openEO Python client returns the same :py:class:`SaveResult` object
30+
in both cases however.
31+
It does that not only for simplicity,
32+
but also because it seems more useful (even in legacy openeo-processes 1.x use cases)
33+
to follow the new STAC resource based usage patterns
34+
than to strictly return some boolean wrapper nobody has use for.
1035
1136
.. versionadded:: 0.39.0
1237
"""

0 commit comments

Comments
 (0)