rs-client-libraries 0.2a10__tar.gz → 99.99__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/PKG-INFO +13 -10
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/pyproject.toml +34 -31
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_client/__init__.py +1 -1
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_client/cadip_client.py +2 -2
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_client/rs_client.py +8 -14
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_client/stac_client.py +2 -3
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_common/opentelemetry.py +2 -1
- rs_client_libraries-99.99/rs_workflows/__init__.py +18 -0
- rs_client_libraries-99.99/rs_workflows/config/dpr_config_template.yaml +43 -0
- rs_client_libraries-99.99/rs_workflows/example.py +43 -0
- rs_client_libraries-99.99/rs_workflows/s1_l0.py +497 -0
- rs_client_libraries-99.99/rs_workflows/staging.py +512 -0
- rs_client_libraries-0.2a10/rs_client/staging_client.py +0 -311
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/LICENSE +0 -0
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/README.adoc +0 -0
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_client/auxip_client.py +0 -0
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_common/__init__.py +0 -0
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_common/config.py +0 -0
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_common/logging.py +0 -0
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_common/serialization.py +0 -0
- {rs_client_libraries-0.2a10 → rs_client_libraries-99.99}/rs_common/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: rs-client-libraries
|
|
3
|
-
Version:
|
|
3
|
+
Version: 99.99
|
|
4
4
|
Summary: Copernicus Sentinel rs-client library and processing workflows.
|
|
5
5
|
Home-page: https://home.rs-python.eu/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -19,17 +19,20 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.13
|
|
20
20
|
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
21
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
-
Requires-Dist: cachetools (>=5.
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist: opentelemetry-distro (>=0.
|
|
25
|
-
Requires-Dist: opentelemetry-exporter-otlp (>=1.
|
|
26
|
-
Requires-Dist: opentelemetry-instrumentation-aws-lambda (>=0.
|
|
27
|
-
Requires-Dist: opentelemetry-test-utils (>=0.
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist:
|
|
22
|
+
Requires-Dist: cachetools (>=5.3.3,<6.0.0)
|
|
23
|
+
Requires-Dist: numpy (==2.1.2)
|
|
24
|
+
Requires-Dist: opentelemetry-distro (>=0.48b0,<0.49)
|
|
25
|
+
Requires-Dist: opentelemetry-exporter-otlp (>=1.27.0,<2.0.0)
|
|
26
|
+
Requires-Dist: opentelemetry-instrumentation-aws-lambda (>=0.48b0,<0.49)
|
|
27
|
+
Requires-Dist: opentelemetry-test-utils (>=0.48b0,<0.49)
|
|
28
|
+
Requires-Dist: prefect (>=2.14.21,<3.0.0)
|
|
29
|
+
Requires-Dist: prefect-dask (>=0.2.6,<0.3.0)
|
|
30
|
+
Requires-Dist: pystac (>=1.10.1,<2.0.0)
|
|
31
|
+
Requires-Dist: pystac-client (>=0.8.1,<0.9.0)
|
|
30
32
|
Requires-Dist: python-dateutil (>=2.9.0.post0,<3.0.0)
|
|
31
33
|
Requires-Dist: python-logging-loki (>=0.3.1,<0.4.0)
|
|
32
|
-
Requires-Dist:
|
|
34
|
+
Requires-Dist: shapely (>=2.0.6,<3.0.0)
|
|
35
|
+
Requires-Dist: starlette (>=0.38.4,<0.39.0)
|
|
33
36
|
Project-URL: Documentation, https://home.rs-python.eu/rs-documentation/rs-client-libraries/docs/doc/
|
|
34
37
|
Project-URL: Repository, https://github.com/RS-PYTHON/rs-client-libraries
|
|
35
38
|
Description-Content-Type: text/plain
|
|
@@ -4,7 +4,7 @@ version = "0.0.0" # see: https://github.com/mtkennerly/poetry-dynamic-versioning
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "rs-client-libraries"
|
|
7
|
-
version = "
|
|
7
|
+
version = "99.99"
|
|
8
8
|
description = "Copernicus Sentinel rs-client library and processing workflows."
|
|
9
9
|
license = "Apache-2.0"
|
|
10
10
|
authors = ["ESA under contract with Airbus and CS <ops_coprs@airbus.com>"]
|
|
@@ -27,52 +27,55 @@ classifiers = [
|
|
|
27
27
|
packages = [
|
|
28
28
|
{ include = "rs_client" },
|
|
29
29
|
{ include = "rs_common" },
|
|
30
|
+
{ include = "rs_workflows" },
|
|
30
31
|
]
|
|
31
32
|
|
|
32
|
-
#
|
|
33
|
-
|
|
34
|
-
{ path = "config", format = ["wheel"] }
|
|
35
|
-
]
|
|
33
|
+
# This root project is not used in release production.
|
|
34
|
+
# It's only used by the CI/CD to run pytest, pylint, mypy etc... on the whole github project.
|
|
36
35
|
|
|
36
|
+
# All the dependencies for release are set in the sub-projects
|
|
37
37
|
[tool.poetry.dependencies]
|
|
38
38
|
python = "^3.11"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
opentelemetry-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
prefect = "^2.14.21"
|
|
40
|
+
numpy = "2.1.2"
|
|
41
|
+
prefect-dask = "^0.2.6"
|
|
42
|
+
opentelemetry-distro = "^0.48b0" # then run 'poetry run opentelemetry-bootstrap -a install'
|
|
43
|
+
opentelemetry-instrumentation-aws-lambda = "^0.48b0"
|
|
44
|
+
opentelemetry-test-utils = "^0.48b0"
|
|
45
|
+
opentelemetry-exporter-otlp = "^1.27.0"
|
|
46
|
+
python-logging-loki = "^0.3.1"
|
|
47
|
+
cachetools = "^5.3.3"
|
|
48
|
+
pystac = "^1.10.1"
|
|
49
|
+
pystac-client = "^0.8.1"
|
|
50
|
+
starlette = "^0.38.4"
|
|
47
51
|
python-dateutil = "^2.9.0.post0"
|
|
48
|
-
|
|
49
|
-
openapi-core = "^0.19.4"
|
|
52
|
+
shapely = "^2.0.6"
|
|
50
53
|
|
|
51
54
|
[tool.poetry.group.dev]
|
|
52
55
|
optional = true
|
|
53
56
|
|
|
57
|
+
# All the dev dependencies are set here so they can be used by the CI.
|
|
54
58
|
[tool.poetry.group.dev.dependencies]
|
|
55
|
-
pytest = "^
|
|
56
|
-
pytest-cov = "^
|
|
57
|
-
pytest-mock = "^3.
|
|
59
|
+
pytest = "^7.4.3"
|
|
60
|
+
pytest-cov = "^4.1.0"
|
|
61
|
+
pytest-mock = "^3.12.0"
|
|
58
62
|
pytest-error-for-skips = "^2.0.2"
|
|
59
|
-
black = "==
|
|
60
|
-
mypy = "^1.
|
|
61
|
-
pre-commit = "^
|
|
62
|
-
bandit = "^1.
|
|
63
|
-
safety = "^3.2.
|
|
64
|
-
pylint = "^3.3
|
|
65
|
-
pytest-docker = "^
|
|
66
|
-
sphinx = "^
|
|
67
|
-
sphinx-rtd-theme = "^
|
|
68
|
-
flake8 = "^
|
|
63
|
+
black = "==24.3.0"
|
|
64
|
+
mypy = "^1.6.1"
|
|
65
|
+
pre-commit = "^3.5.0"
|
|
66
|
+
bandit = "^1.7.5"
|
|
67
|
+
safety = "^3.2.0"
|
|
68
|
+
pylint = "^3.0.3"
|
|
69
|
+
pytest-docker = "^2.0.1"
|
|
70
|
+
sphinx = "^7.2.6"
|
|
71
|
+
sphinx-rtd-theme = "^2.0.0"
|
|
72
|
+
flake8 = "^6.1.0"
|
|
69
73
|
flake8-pyproject = "^1.2.3"
|
|
70
|
-
responses = "^0.25.
|
|
71
|
-
starlette = "^0.45.3"
|
|
74
|
+
responses = "^0.25.0"
|
|
72
75
|
|
|
73
76
|
[tool.poetry.group.demo.dependencies] # for hybrid mode
|
|
74
77
|
jupyterlab = "^4.2.1"
|
|
75
|
-
boto3 = "^1.
|
|
78
|
+
boto3 = "^1.34.91"
|
|
76
79
|
papermill = "^2.6.0"
|
|
77
80
|
|
|
78
81
|
[tool.poetry-dynamic-versioning] # needs: poetry self add "poetry-dynamic-versioning[plugin]"
|
|
@@ -32,7 +32,7 @@ class CadipClient(RsClient):
|
|
|
32
32
|
station (ECadipStation): Cadip station
|
|
33
33
|
"""
|
|
34
34
|
|
|
35
|
-
def __init__( # pylint: disable=too-many-arguments
|
|
35
|
+
def __init__( # pylint: disable=too-many-arguments
|
|
36
36
|
self,
|
|
37
37
|
rs_server_href: str | None,
|
|
38
38
|
rs_server_api_key: str | None,
|
|
@@ -90,7 +90,7 @@ class CadipClient(RsClient):
|
|
|
90
90
|
# Call RS-Server endpoints #
|
|
91
91
|
############################
|
|
92
92
|
|
|
93
|
-
def search_sessions( # pylint: disable=too-many-arguments
|
|
93
|
+
def search_sessions( # pylint: disable=too-many-arguments
|
|
94
94
|
self,
|
|
95
95
|
session_ids: list[str] | None = None,
|
|
96
96
|
start_date: datetime | None = None,
|
|
@@ -252,16 +252,6 @@ class RsClient: # pylint: disable=too-many-instance-attributes
|
|
|
252
252
|
**kwargs,
|
|
253
253
|
)
|
|
254
254
|
|
|
255
|
-
def get_staging_client(self) -> "StagingClient": # type: ignore # noqa: F821
|
|
256
|
-
"""
|
|
257
|
-
Return an instance of the child class AuxipClient, with the same attributes as this "self" instance.
|
|
258
|
-
"""
|
|
259
|
-
from rs_client.staging_client import ( # pylint: disable=import-outside-toplevel,cyclic-import
|
|
260
|
-
StagingClient,
|
|
261
|
-
)
|
|
262
|
-
|
|
263
|
-
return StagingClient(self.rs_server_href, self.rs_server_api_key, self.owner_id, self.logger)
|
|
264
|
-
|
|
265
255
|
############################
|
|
266
256
|
# Call RS-Server endpoints #
|
|
267
257
|
############################
|
|
@@ -321,6 +311,7 @@ class RsClient: # pylint: disable=too-many-instance-attributes
|
|
|
321
311
|
|
|
322
312
|
Raises:
|
|
323
313
|
RuntimeError: If an error occurs while staging the file.
|
|
314
|
+
|
|
324
315
|
"""
|
|
325
316
|
|
|
326
317
|
# dictionary to be used for payload request
|
|
@@ -353,7 +344,7 @@ class RsClient: # pylint: disable=too-many-instance-attributes
|
|
|
353
344
|
self.logger.exception(f"Staging file exception for {filename}:", e)
|
|
354
345
|
raise RuntimeError(f"Staging file exception for {filename}") from e
|
|
355
346
|
|
|
356
|
-
def search_stations( # pylint: disable=too-many-arguments
|
|
347
|
+
def search_stations( # pylint: disable=too-many-arguments
|
|
357
348
|
self,
|
|
358
349
|
start_date: datetime,
|
|
359
350
|
stop_date: datetime,
|
|
@@ -427,13 +418,16 @@ class RsClient: # pylint: disable=too-many-instance-attributes
|
|
|
427
418
|
##############################################
|
|
428
419
|
|
|
429
420
|
@property
|
|
430
|
-
def href_search(self):
|
|
421
|
+
def href_search(self) -> str:
|
|
431
422
|
"""Implemented by AuxipClient and CadipClient."""
|
|
423
|
+
raise NotImplementedError
|
|
432
424
|
|
|
433
425
|
@property
|
|
434
|
-
def href_staging(self):
|
|
426
|
+
def href_staging(self) -> str:
|
|
435
427
|
"""Implemented by AuxipClient and CadipClient."""
|
|
428
|
+
raise NotImplementedError
|
|
436
429
|
|
|
437
430
|
@property
|
|
438
|
-
def href_status(self):
|
|
431
|
+
def href_status(self) -> str:
|
|
439
432
|
"""Implemented by AuxipClient and CadipClient."""
|
|
433
|
+
raise NotImplementedError
|
|
@@ -52,8 +52,7 @@ class StacClient(RsClient, Client): # type: ignore # pylint: disable=too-many-a
|
|
|
52
52
|
# Initialisation #
|
|
53
53
|
##################
|
|
54
54
|
|
|
55
|
-
#
|
|
56
|
-
def __init__( # pylint: disable=too-many-arguments, too-many-positional-arguments, super-init-not-called
|
|
55
|
+
def __init__( # pylint: disable=too-many-arguments,super-init-not-called # super-init is called in .open(...)
|
|
57
56
|
self,
|
|
58
57
|
id: str, # pylint: disable=redefined-builtin
|
|
59
58
|
description: str,
|
|
@@ -89,7 +88,7 @@ class StacClient(RsClient, Client): # type: ignore # pylint: disable=too-many-a
|
|
|
89
88
|
)
|
|
90
89
|
|
|
91
90
|
@classmethod
|
|
92
|
-
def open( # type: ignore # pylint: disable=arguments-renamed, too-many-arguments
|
|
91
|
+
def open( # type: ignore # pylint: disable=arguments-renamed, too-many-arguments
|
|
93
92
|
cls,
|
|
94
93
|
# RsClient parameters
|
|
95
94
|
rs_server_href: str | None,
|
|
@@ -24,6 +24,7 @@ from opentelemetry import trace
|
|
|
24
24
|
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
|
|
25
25
|
from opentelemetry.instrumentation.asyncio import AsyncioInstrumentor
|
|
26
26
|
from opentelemetry.instrumentation.aws_lambda import AwsLambdaInstrumentor
|
|
27
|
+
from opentelemetry.instrumentation.httpx import HTTPXClientInstrumentor
|
|
27
28
|
from opentelemetry.instrumentation.instrumentor import BaseInstrumentor # type: ignore
|
|
28
29
|
from opentelemetry.sdk.resources import Resource
|
|
29
30
|
from opentelemetry.sdk.trace import TracerProvider
|
|
@@ -100,7 +101,7 @@ def init_traces(service_name: str):
|
|
|
100
101
|
classes.add(_class)
|
|
101
102
|
|
|
102
103
|
# Don't instrument these classes, they have errors, maybe we should see why
|
|
103
|
-
if _class in [AsyncioInstrumentor, AwsLambdaInstrumentor, BaseInstrumentor]:
|
|
104
|
+
if _class in [AsyncioInstrumentor, AwsLambdaInstrumentor, BaseInstrumentor, HTTPXClientInstrumentor]:
|
|
104
105
|
continue
|
|
105
106
|
|
|
106
107
|
# If the "instrument" method exists, call it
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Copyright 2024 CS Group
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""rs-workflows main module."""
|
|
16
|
+
|
|
17
|
+
# Set automatically by running `poetry dynamic-versioning`
|
|
18
|
+
__version__ = "99.99"
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Copyright 2024 CS Group
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
general_configuration:
|
|
16
|
+
logging:
|
|
17
|
+
level: DEBUG
|
|
18
|
+
triggering__validate_run: true
|
|
19
|
+
triggering__use_default_filename: true
|
|
20
|
+
triggering__use_basic_logging: true
|
|
21
|
+
triggering__load_default_logging: false
|
|
22
|
+
breakpoints:
|
|
23
|
+
workflow:
|
|
24
|
+
- step: 1
|
|
25
|
+
active: true
|
|
26
|
+
module: rs.dpr.mockup # string corresponding to the python path of the module
|
|
27
|
+
processing_unit: DprMockupProcessor # EOProcessingUnit class name
|
|
28
|
+
name: DprMockupProcessor # identifier for the processing unit
|
|
29
|
+
inputs:
|
|
30
|
+
-
|
|
31
|
+
outputs:
|
|
32
|
+
-
|
|
33
|
+
parameters:
|
|
34
|
+
product_types: # List of EOPF product types we want to generate. In this example we simulate S1L0 processor that generates 4 products
|
|
35
|
+
-
|
|
36
|
+
I/O:
|
|
37
|
+
inputs_products:
|
|
38
|
+
-
|
|
39
|
+
output_products:
|
|
40
|
+
-
|
|
41
|
+
dask_context: {}
|
|
42
|
+
logging: {}
|
|
43
|
+
config: {}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Copyright 2024 CS Group
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""Prefect flow example for rs-client-libraries"""
|
|
16
|
+
from prefect import flow, task
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@task
|
|
20
|
+
def print_hello(name: str):
|
|
21
|
+
"""Example task to be used in a prefect flow
|
|
22
|
+
|
|
23
|
+
This prefect task may be used as start point in creating your own prefect tasks
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
name (str): Username to be printed
|
|
27
|
+
"""
|
|
28
|
+
print(f"Hello {name}!")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@flow(name="Hello RS-Server flow ")
|
|
32
|
+
def hello_world(name="COPERNICUS", tasks_number=2):
|
|
33
|
+
"""Example flow that can be use in a COPERNICUS chain
|
|
34
|
+
|
|
35
|
+
This prefect flow may be used as start point in creating your own prefect flows. It runs in parallel
|
|
36
|
+
tasks_number of print_hello
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
name (str): Username to be printed. Default COPERNICUS
|
|
40
|
+
tasks_number (int): Number of tasks to be run. Default 2
|
|
41
|
+
"""
|
|
42
|
+
for idx in range(0, tasks_number):
|
|
43
|
+
print_hello(name + "_" + str(idx))
|