Skip to content

Commit 877c1a3

Browse files
Merge branch 'master' into issue693-sar_backscatter-get-coefficients-from-schema
2 parents 454cf79 + 000b026 commit 877c1a3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3386
-1068
lines changed

CHANGELOG.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12-
- Added `show_error_logs` argument to `cube.execute_batch()`/`job.start_and_wait()`/... to toggle the automatic printing of error logs on failure ([#505](https://github.com/Open-EO/openeo-python-client/issues/505))
12+
- Add initial support for accessing [Federation Extension](https://github.com/Open-EO/openeo-api/tree/master/extensions/federation) related metadata ([#668](https://github.com/Open-EO/openeo-python-client/issues/668))
1313

1414
### Changed
1515

16+
- Improved tracking of metadata changes with `resample_spatial` and `resample_cube_spatial` ([#690](https://github.com/Open-EO/openeo-python-client/issues/690))
17+
- Move `ComparableVersion` to `openeo.utils.version` (related to [#611](https://github.com/Open-EO/openeo-python-client/issues/611))
18+
- Deprecate `openeo.rest.rest_capabilities.RESTCapabilities` and introduce replacement `openeo.rest.capabilities.OpenEoCapabilities` ([#611](https://github.com/Open-EO/openeo-python-client/issues/611), [#610](https://github.com/Open-EO/openeo-python-client/issues/610))
19+
- `MultiBackendJobManager`: start new jobs before downloading the results of finished jobs to use time more efficiently ([#633](https://github.com/Open-EO/openeo-python-client/issues/633))
20+
1621
### Removed
1722

23+
- Remove unnecessary base class `openeo.capabilities.Capabilities` [#611](https://github.com/Open-EO/openeo-python-client/issues/611)
24+
25+
### Fixed
26+
27+
- `CsvJobDatabase`: workaround GeoPandas issue (on Python>3.9) when there is a column named "crs" ([#714](https://github.com/Open-EO/openeo-python-client/issues/714))
28+
29+
30+
## [0.37.0] - 2025-01-21 - "SAP10" release
31+
32+
### Added
33+
34+
- Added `show_error_logs` argument to `cube.execute_batch()`/`job.start_and_wait()`/... to toggle the automatic printing of error logs on failure ([#505](https://github.com/Open-EO/openeo-python-client/issues/505))
35+
- Added `Connection.web_editor()` to build link to the openEO backend in the openEO Web Editor
36+
- Add support for `log_level` in `create_job()` and `execute_job()` ([#704](https://github.com/Open-EO/openeo-python-client/issues/704))
37+
- Add initial support for "geometry" dimension type in `CubeMetadata` ([#705](https://github.com/Open-EO/openeo-python-client/issues/705))
38+
- Add support for parameterized `bands` argument in `load_stac()`
39+
- Argument `spatial_extent` in `load_collection()`/`load_stac()`: add support for Shapely objects, loading GeoJSON from a local path and loading geometry from GeoJSON/GeoParquet URL. ([#678](https://github.com/Open-EO/openeo-python-client/issues/678))
40+
41+
### Changed
42+
43+
- Raise exception when providing empty bands array to `load_collection`/`load_stac` ([#424](https://github.com/Open-EO/openeo-python-client/issues/424), [Open-EO/openeo-processes#372](https://github.com/Open-EO/openeo-processes/issues/372))
44+
- Start showing deprecation warnings on usage of GeoJSON "GeometryCollection" (in `filter_spatial`, `aggregate_spatial`, `chunk_polygon`, `mask_polygon`). Use a GeoJSON FeatureCollection instead. ([#706](https://github.com/Open-EO/openeo-python-client/issues/706), [Open-EO/openeo-processes#389](https://github.com/Open-EO/openeo-processes/issues/389))
45+
- The `context` parameter is now used in `execute_local_udf` ([#556](https://github.com/Open-EO/openeo-python-client/issues/556)
46+
1847
### Fixed
1948

49+
- Clear capabilities cache on login ([#254](https://github.com/Open-EO/openeo-python-client/issues/254))
50+
2051

2152
## [0.36.0] - 2024-12-10
2253

docs/api.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,30 @@ openeo.metadata
6363
:members: CollectionMetadata, BandDimension, SpatialDimension, TemporalDimension
6464

6565

66+
openeo.rest.capabilities
67+
------------------------
68+
69+
.. automodule:: openeo.rest.capabilities
70+
:members: OpenEoCapabilities
71+
72+
73+
openeo.rest.models
74+
-------------------
75+
76+
.. automodule:: openeo.rest.models.general
77+
:members:
78+
79+
.. automodule:: openeo.rest.models.logs
80+
:members: LogEntry, normalize_log_level
81+
82+
6683
openeo.api.process
6784
--------------------
6885

6986
.. automodule:: openeo.api.process
7087
:members: Parameter
7188

7289

73-
openeo.api.logs
74-
-----------------
75-
76-
.. automodule:: openeo.api.logs
77-
:members: LogEntry, normalize_log_level
78-
7990

8091
openeo.rest.connection
8192
----------------------

docs/auth.rst

Lines changed: 50 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,6 @@ we start form a back-end connection::
2222

2323
connection = openeo.connect("https://openeo.example.com")
2424

25-
Basic HTTP Auth
26-
===============
27-
28-
Let's start with the easiest authentication method,
29-
based on the Basic HTTP authentication scheme.
30-
It is however *not recommended* for various reasons,
31-
such as its limited *security* measures.
32-
For example, if you are connecting to a back-end with a ``http://`` URL
33-
instead of a ``https://`` one, you should certainly not use basic HTTP auth.
34-
35-
With these security related caveats out of the way, you authenticate
36-
using your username and password like this::
37-
38-
connection.authenticate_basic("john", "j0hn123")
39-
40-
Subsequent usage of the connection object ``connection`` will
41-
use authenticated calls.
42-
For example, show information about the authenticated user::
43-
44-
>>> connection.describe_account()
45-
{'user_id': 'john'}
46-
47-
4825

4926
OpenID Connect Based Authentication
5027
===================================
@@ -90,15 +67,15 @@ in the context of working with openEO:
9067
* :ref:`authenticate_oidc_refresh_token`
9168

9269

93-
OpenID Connect is clearly more complex than Basic HTTP Auth.
70+
9471
In the sections below we will discuss the practical details of each flow.
9572

9673
General options
9774
---------------
9875

9976
* A back-end might support **multiple OpenID Connect providers**.
10077
The openEO Python Client Library will pick the first one by default,
101-
but another another provider can specified explicity with the ``provider_id`` argument, e.g.:
78+
but another another provider can specified explicitly with the ``provider_id`` argument, e.g.:
10279

10380
.. code-block:: python
10481
@@ -329,7 +306,6 @@ For example:
329306
330307
331308
332-
333309
.. _auth_configuration_files:
334310
335311
Auth config files and ``openeo-auth`` helper tool
@@ -403,27 +379,6 @@ the current configuration and stored refresh tokens, e.g.::
403379
The sensitive information (like passwords) are redacted by default.
404380
405381
406-
407-
Basic HTTP Auth config
408-
-----------------------
409-
410-
With the ``add-basic`` subcommand you can add Basic HTTP Auth credentials
411-
for a given back-end to the config.
412-
It will interactively ask for username and password and
413-
try if these credentials work::
414-
415-
$ openeo-auth add-basic https://openeo.example.com/
416-
Enter username and press enter: john
417-
Enter password and press enter:
418-
Trying to authenticate with 'https://openeo.example.com'
419-
Successfully authenticated 'john'
420-
Saved credentials to '/home/john/.config/openeo-python-client/auth-config.json'
421-
422-
Now you can authenticate in your application without having to
423-
specify username and password explicitly::
424-
425-
connection.authenticate_basic()
426-
427382
OpenID Connect configs
428383
-----------------------
429384
@@ -472,6 +427,54 @@ For example::
472427
473428
474429
430+
431+
Basic HTTP Auth
432+
===============
433+
434+
The easiest authentication method is
435+
based on the Basic HTTP authentication scheme.
436+
It is however *not recommended* for various reasons,
437+
such as its limited *security* measures.
438+
For example, if you are connecting to a back-end with a ``http://`` URL
439+
instead of a ``https://`` one, you should certainly not use basic HTTP auth.
440+
441+
With these security related caveats out of the way, you authenticate
442+
using your username and password like this::
443+
444+
connection.authenticate_basic("john", "j0hn123")
445+
446+
Subsequent usage of the connection object ``connection`` will
447+
use authenticated calls.
448+
For example, show information about the authenticated user::
449+
450+
>>> connection.describe_account()
451+
{'user_id': 'john'}
452+
453+
454+
455+
456+
Basic HTTP Auth config
457+
-----------------------
458+
459+
With the ``add-basic`` subcommand you can add Basic HTTP Auth credentials
460+
for a given back-end to the config.
461+
It will interactively ask for username and password and
462+
try if these credentials work::
463+
464+
$ openeo-auth add-basic https://openeo.example.com/
465+
Enter username and press enter: john
466+
Enter password and press enter:
467+
Trying to authenticate with 'https://openeo.example.com'
468+
Successfully authenticated 'john'
469+
Saved credentials to '/home/john/.config/openeo-python-client/auth-config.json'
470+
471+
Now you can authenticate in your application without having to
472+
specify username and password explicitly::
473+
474+
connection.authenticate_basic()
475+
476+
477+
475478
.. _default_url_and_auto_auth:
476479
477480
Default openEO back-end URL and auto-authentication

docs/basics.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ and observations are filtered out:
317317

318318
.. image:: _static/images/basics/evi-masked-composite.png
319319

320+
.. _aggregate-spatial-evi
320321
321322
Aggregated EVI timeseries
322323
===========================

docs/cookbook/job_manager.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _job-manager
2+
13
====================================
24
Multi Backend Job Manager
35
====================================

docs/cookbook/sampling.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11

22
# Dataset sampling
33

4-
54
A number of use cases do not require a full datacube to be computed,
65
but rather want to extract a result at specific locations.
76
Examples include extracting training data for model calibration, or computing the result for
87
areas where validation data is available.
98

109
An important constraint is that most implementations assume that sampling is an operation
1110
on relatively small areas, of for instance up to 512x512 pixels (but often much smaller).
12-
When extracting larger areas, it is recommended to look into running a separate job per 'sample'.
11+
When extracting polygons with larger areas, it is recommended to look into running a separate job per 'sample'.
12+
Some more important performance notices are mentioned later in the chapter, please read them carefully
13+
to get best results.
1314

1415
Sampling can be done for points or polygons:
1516

1617
- point extractions basically result in a 'vector cube', so can be exported into tabular formats.
1718
- polygon extractions can be stored to an individual netCDF per polygon so in this case the output is a sparse raster cube.
1819

20+
Note that sampling many points or polygons may require to send a large amount of geometry, which sometimes makes the size
21+
of the requests too large when it is included inline as GeoJson. Therefore, we recommend to upload your vector data to a
22+
public url, and to load it in openEO using {py:meth}`openeo.rest.connection.Connection.load_url`.
23+
24+
## Sampling at point locations
25+
26+
To sample point locations, the `openeo.rest.datacube.DataCube.aggregate_spatial` method can be used. The reducer can be a
27+
commonly supported reducer like `min`, `max` or `mean` and will receive only one value as input in most cases. Note that
28+
in edge cases, a point can intersect with up to 4 pixels. If this is not desirable, it might be worth trying to align
29+
points with pixel centers, which does require more advanced knowledge of the pixel grid of your data cube.
30+
31+
More information on `aggregate_spatial` is available [here](_aggregate-spatial-evi).
32+
33+
## Sampling polygons as rasters
34+
1935
To indicate to openEO that we only want to compute the datacube for certain polygon features, we use the
2036
`openeo.rest.datacube.DataCube.filter_spatial` method.
2137

@@ -59,3 +75,5 @@ When doing large scale (e.g. continental) sampling, it is usually not possible o
5975
batch job. The recommendation here is to apply a spatial grouping to your sampling locations, with a single group covering
6076
an area of around 100x100km. The optimal size of a group may be backend dependant. Also remember that when working with
6177
data in the UTM projection, you may want to avoid covering multiple UTM zones in a single group.
78+
79+
See also how to manage [multiple jobs](_job-manager).

docs/federation-extension.rst

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
.. _federation-extension:
3+
4+
===========================
5+
openEO Federation Extension
6+
===========================
7+
8+
9+
The `openEO Federation extension <https://github.com/Open-EO/openeo-api/tree/master/extensions/federation>`_
10+
is a set of additional specifications,
11+
on top of the standard openEO API specification,
12+
to address the need for extra metadata in the context
13+
of federated openEO processing,
14+
where multiple (separately operated) openEO services are bundled together
15+
behind a single API endpoint.
16+
17+
18+
Accessing federation extension metadata
19+
========================================
20+
21+
The openEO Python client library provides access to this additional metadata
22+
in a couple of resources.
23+
24+
.. versionadded:: 0.38.0
25+
initial support to access federation extension related metadata.
26+
27+
.. warning:: this API is experimental and subject to change.
28+
29+
30+
Backend details
31+
---------------
32+
33+
Participating backends in a federation are listed under the ``federation`` field
34+
of the capabilities document (``GET /``) and can be inspected
35+
using :py:meth:`OpenEoCapabilities.ext_federation_backend_details() <openeo.rest.capabilities.OpenEoCapabilities.ext_federation_backend_details>`:
36+
37+
.. code-block:: python
38+
39+
import openeo
40+
connection = openeo.connect(url=...)
41+
capabilities = connection.capabilities()
42+
print("Federated backends:", capabilities.ext_federation_backend_details())
43+
44+
45+
Unavailable backends (``federation:missing``)
46+
----------------------------------------------
47+
48+
When listing resources like
49+
collections (with :py:meth:`Connection.list_collections() <openeo.rest.connection.Connection.list_collections>`),
50+
processes (with :py:meth:`Connection.list_processes() <openeo.rest.connection.Connection.list_processes>`),
51+
jobs (with :py:meth:`Connection.list_jobs() <openeo.rest.connection.Connection.list_jobs>`),
52+
etc.,
53+
there might be items missing due to federation participants being temporarily unavailable.
54+
These missing federation components are listed in the response under the ``federation:missing`` field
55+
and can be inspected as follows:
56+
57+
.. code-block:: python
58+
59+
import openeo
60+
connection = openeo.connect(url=...)
61+
collections = connection.list_collections()
62+
print("Number of collections:", len(collections))
63+
print("Missing federation components:", collections.ext_federation_missing())
64+
65+
66+
Note that the ``collections`` object in this example, returned by
67+
:py:meth:`Connection.list_collections() <openeo.rest.connection.Connection.list_collections>`,
68+
acts at the surface as a simple list of dictionaries with collection metadata,
69+
but also provides additional properties/methods like
70+
:py:attr:`ext_federation_missing() <openeo.rest.models.general.CollectionListingResponse.ext_federation_missing>`.

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Table of contents
6464
process_mapping
6565
development
6666
best_practices
67+
Federation extension <federation-extension>
6768
changelog
6869

6970

openeo/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.37.0a1"
1+
__version__ = "0.38.0a3"

0 commit comments

Comments
 (0)