Skip to content

Commit

Permalink
Issue #720/#402/#725 changelog and more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Feb 12, 2025
1 parent cc57804 commit 42ed8df
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

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

### Changed

- `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))

### Removed

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions docs/process_mapping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ method or function in the openEO Python Client Library.
- :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__>`
* - `exp <https://processes.openeo.org/#exp>`_
- :py:meth:`ProcessBuilder.exp() <openeo.processes.ProcessBuilder.exp>`, :py:meth:`exp() <openeo.processes.exp>`
* - `export_workspace <https://processes.openeo.org/#export_workspace>`_
- :py:meth:`StacResource.export_workspace() <openeo.rest.stac_resource.StacResource.export_workspace>`
* - `extrema <https://processes.openeo.org/#extrema>`_
- :py:meth:`ProcessBuilder.extrema() <openeo.processes.ProcessBuilder.extrema>`, :py:meth:`extrema() <openeo.processes.extrema>`
* - `filter_bands <https://processes.openeo.org/#filter_bands>`_
Expand Down
11 changes: 11 additions & 0 deletions openeo/rest/datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -2330,9 +2330,20 @@ def atmospheric_correction(self, method: str = None, elevation_model: str = None
@openeo_process
def save_result(
self,
# TODO: does it make sense for the client to define a (hard coded) default format here?
format: str = _DEFAULT_RASTER_FORMAT,
options: Optional[dict] = None,
) -> SaveResult:
"""
Materialize the processed data to the given file format.
:param format: an output format supported by the backend.
:param options: file format options
.. versionchanged:: 0.39.0
returns a :py:class:`~openeo.rest.result.SaveResult` instance instead
of another :py:class:`~openeo.rest.datacube.DataCube` instance.
"""
if self._connection:
formats = set(self._connection.list_output_formats().keys())
# TODO: map format to correct casing too?
Expand Down
6 changes: 6 additions & 0 deletions openeo/rest/stac_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def export_workspace(self, workspace: str, merge: Union[str, None] = None) -> St
(e.g., a STAC Collection) to the given user workspace.
The STAC resource itself is exported with all STAC resources and assets underneath.
:param workspace: The identifier of the workspace to export to.
:param merge: (optional) Provides a cloud-specific path identifier
to a STAC resource to merge the given STAC resource into.
If not provided, the STAC resource is kept separate
from any other STAC resources in the workspace.
:return: the potentially updated STAC resource.
"""
return StacResource(
Expand Down
17 changes: 16 additions & 1 deletion openeo/rest/vectorcube.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,22 @@ def run_udf(
)

@openeo_process
def save_result(self, format: Union[str, None] = "GeoJSON", options: dict = None) -> SaveResult:
def save_result(
self,
# TODO: does it make sense for the client to define a (hard coded) default format here?
format: Union[str, None] = "GeoJSON",
options: dict = None,
) -> SaveResult:
"""
Materialize the processed data to the given file format.
:param format: an output format supported by the backend.
:param options: file format options
.. versionchanged:: 0.39.0
returns a :py:class:`~openeo.rest.result.SaveResult` instance instead
of another :py:class:`~openeo.rest.vectorcube.VectorCube` instance.
"""
pg = self._build_pgnode(
process_id="save_result",
arguments={
Expand Down

0 comments on commit 42ed8df

Please sign in to comment.