Skip to content

Commit be0fd37

Browse files
committed
Issue #720/#402/#725 changelog and more docs
1 parent e35eb5b commit be0fd37

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Add support for `export_workspace` process ([#720](https://github.com/Open-EO/openeo-python-client/issues/720))
13+
1214
### Changed
1315

16+
- `DataCube.save_result()` (and related methods) now return a `SaveResult`/`StacResource` object instead of another `DataCube` object to be more in line with the official `save_result` specification ([#402](https://github.com/Open-EO/openeo-python-client/issues/402), [#720](https://github.com/Open-EO/openeo-python-client/issues/720))
17+
1418
### Removed
1519

1620
### Fixed

docs/process_mapping.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ method or function in the openEO Python Client Library.
144144
- :py:meth:`ProcessBuilder.__eq__() <openeo.processes.ProcessBuilder.__eq__>`, :py:meth:`ProcessBuilder.eq() <openeo.processes.ProcessBuilder.eq>`, :py:meth:`eq() <openeo.processes.eq>`, :py:meth:`DataCube.__eq__() <openeo.rest.datacube.DataCube.__eq__>`
145145
* - `exp <https://processes.openeo.org/#exp>`_
146146
- :py:meth:`ProcessBuilder.exp() <openeo.processes.ProcessBuilder.exp>`, :py:meth:`exp() <openeo.processes.exp>`
147+
* - `export_workspace <https://processes.openeo.org/#export_workspace>`_
148+
- :py:meth:`StacResource.export_workspace() <openeo.rest.stac_resource.StacResource.export_workspace>`
147149
* - `extrema <https://processes.openeo.org/#extrema>`_
148150
- :py:meth:`ProcessBuilder.extrema() <openeo.processes.ProcessBuilder.extrema>`, :py:meth:`extrema() <openeo.processes.extrema>`
149151
* - `filter_bands <https://processes.openeo.org/#filter_bands>`_

openeo/rest/datacube.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,9 +2330,20 @@ def atmospheric_correction(self, method: str = None, elevation_model: str = None
23302330
@openeo_process
23312331
def save_result(
23322332
self,
2333+
# TODO: does it make sense for the client to define a (hard coded) default format here?
23332334
format: str = _DEFAULT_RASTER_FORMAT,
23342335
options: Optional[dict] = None,
23352336
) -> SaveResult:
2337+
"""
2338+
Materialize the processed data to the given file format.
2339+
2340+
:param format: an output format supported by the backend.
2341+
:param options: file format options
2342+
2343+
.. versionchanged:: 0.39.0
2344+
returns a :py:class:`~openeo.rest.result.SaveResult` instance instead
2345+
of another :py:class:`~openeo.rest.datacube.DataCube` instance.
2346+
"""
23362347
if self._connection:
23372348
formats = set(self._connection.list_output_formats().keys())
23382349
# TODO: map format to correct casing too?

openeo/rest/stac_resource.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ def export_workspace(self, workspace: str, merge: Union[str, None] = None) -> St
4545
(e.g., a STAC Collection) to the given user workspace.
4646
The STAC resource itself is exported with all STAC resources and assets underneath.
4747
48+
:param workspace: The identifier of the workspace to export to.
49+
:param merge: (optional) Provides a cloud-specific path identifier
50+
to a STAC resource to merge the given STAC resource into.
51+
If not provided, the STAC resource is kept separate
52+
from any other STAC resources in the workspace.
53+
4854
:return: the potentially updated STAC resource.
4955
"""
5056
return StacResource(

openeo/rest/vectorcube.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,22 @@ def run_udf(
192192
)
193193

194194
@openeo_process
195-
def save_result(self, format: Union[str, None] = "GeoJSON", options: dict = None) -> SaveResult:
195+
def save_result(
196+
self,
197+
# TODO: does it make sense for the client to define a (hard coded) default format here?
198+
format: Union[str, None] = "GeoJSON",
199+
options: dict = None,
200+
) -> SaveResult:
201+
"""
202+
Materialize the processed data to the given file format.
203+
204+
:param format: an output format supported by the backend.
205+
:param options: file format options
206+
207+
.. versionchanged:: 0.39.0
208+
returns a :py:class:`~openeo.rest.result.SaveResult` instance instead
209+
of another :py:class:`~openeo.rest.vectorcube.VectorCube` instance.
210+
"""
196211
pg = self._build_pgnode(
197212
process_id="save_result",
198213
arguments={

0 commit comments

Comments
 (0)