Skip to content

Commit c7a39ed

Browse files
authored
Release 1.5.4, Merge pull request #791 from sentinel-hub/develop
Release 1.5.4
2 parents bd4717b + efa49d4 commit c7a39ed

25 files changed

+204
-152
lines changed

.github/workflows/ci_action.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ jobs:
105105
if: ${{ !matrix.full_test_suite }}
106106
run: pytest -m "not sh_integration and not geopedia"
107107

108-
- name: Upload code coverage
109-
if: ${{ matrix.full_test_suite && github.event_name == 'push' }}
110-
uses: codecov/codecov-action@v2
111-
with:
112-
files: coverage.xml
113-
fail_ci_if_error: true
114-
verbose: false
108+
# - name: Upload code coverage
109+
# if: ${{ matrix.full_test_suite && github.event_name == 'push' }}
110+
# uses: codecov/codecov-action@v2
111+
# with:
112+
# files: coverage.xml
113+
# fail_ci_if_error: true
114+
# verbose: false
115115

116116
mirror-and-integration-test-on-gitlab:
117117
if: github.event_name == 'push'
@@ -121,11 +121,11 @@ jobs:
121121
- name: Mirror + trigger CI
122122
uses: SvanBoxel/gitlab-mirror-and-ci-action@master
123123
with:
124-
args: "https://git.sinergise.com/eo/code/eo-learn/"
124+
args: "https://hello.planet.com/code/eo/code/eo-learn"
125125
env:
126126
FOLLOW_TAGS: "true"
127-
GITLAB_HOSTNAME: "git.sinergise.com"
127+
GITLAB_HOSTNAME: "hello.planet.com/code"
128128
GITLAB_USERNAME: "github-action"
129129
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
130-
GITLAB_PROJECT_ID: "164"
130+
GITLAB_PROJECT_ID: "9715"
131131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci_trigger.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
-F ref=main \
1717
-F variables[CUSTOM_RUN_TAG]=auto \
1818
-F variables[LAYER_NAME]=dotai-eo \
19-
https://git.sinergise.com/api/v4/projects/1031/trigger/pipeline
19+
https://hello.planet.com/code/api/v4/projects/9723/trigger/pipeline

.gitlab-ci.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
image: python:3.9
1+
default:
2+
image: python:3.9
3+
tags:
4+
- sinergise-lju
25

36
stages:
47
- test

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.5.0
3+
rev: v4.6.0
44
hooks:
55
- id: end-of-file-fixer
66
- id: requirements-txt-fixer
@@ -13,18 +13,18 @@ repos:
1313
- id: debug-statements
1414

1515
- repo: https://github.com/psf/black
16-
rev: 23.12.1
16+
rev: 24.4.2
1717
hooks:
1818
- id: black
1919
language_version: python3
2020

2121
- repo: https://github.com/charliermarsh/ruff-pre-commit
22-
rev: "v0.1.11"
22+
rev: "v0.4.4"
2323
hooks:
2424
- id: ruff
2525

2626
- repo: https://github.com/nbQA-dev/nbQA
27-
rev: 1.7.1
27+
rev: 1.8.5
2828
hooks:
2929
- id: nbqa-black
3030
- id: nbqa-ruff

.zenodo.json

+3
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@
209209
},
210210
{
211211
"id": "101059548"
212+
},
213+
{
214+
"id": "101086461"
212215
}
213216
]
214217
}

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [Version 1.5.4] - 2024-05-13
2+
3+
- Minor fixes for documentation
4+
5+
16
## [Version 1.5.3] - 2024-01-10
27

38
- Fix `numpy<2` in anticipation of numpy 2.0 release.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,4 @@ See [LICENSE](https://github.com/sentinel-hub/eo-learn/blob/master/LICENSE).
202202

203203
## Acknowledgements
204204

205-
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreements No. 776115, No. 101004112 and No. 101059548.
205+
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreements No. 776115, No. 101004112, No. 101059548 and No. 101086461.

docs/environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ dependencies:
1010
- sphinx_rtd_theme==1.3.0
1111
- nbsphinx
1212
- jupyter
13-
- sphinx_mdinclude
13+
- sphinx_mdinclude==0.5.4
1414

1515
- ./../.[FULL]

docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def get_subclasses(cls):
265265
module = "eolearn"
266266

267267
APIDOC_OPTIONS = ["--module-first", "--separate", "--no-toc", "--templatedir", os.path.join(current_dir, "_templates")]
268-
APIDOC_EXCLUDE = ["graph.py", "eodata_io.py", "eodata_merge.py"]
268+
APIDOC_EXCLUDE = ["graph.py", "eodata_io.py"]
269269

270270
shutil.rmtree(reference_dir, ignore_errors=True)
271271
shutil.copytree(custom_reference_dir, reference_dir)

eolearn/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Main module of the `eolearn` package."""
22

3-
__version__ = "1.5.3"
3+
__version__ = "1.5.4"
44

55
import importlib.util
66
import warnings

eolearn/core/eoexecution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __init__(
131131

132132
@staticmethod
133133
def _parse_and_validate_execution_kwargs(
134-
execution_kwargs: Iterable[dict[EONode, dict[str, object]]]
134+
execution_kwargs: Iterable[dict[EONode, dict[str, object]]],
135135
) -> list[dict[EONode, dict[str, object]]]:
136136
"""Parses and validates execution arguments provided by user and raises an error if something is wrong."""
137137
for input_kwargs in execution_kwargs:

eolearn/features/extra/interpolation.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,12 @@ def interpolate_data(self, data: np.ndarray, times: np.ndarray, resampled_times:
273273

274274
# array defining index correspondence between reference times and resampled times
275275
min_time, max_time = np.min(resampled_times), np.max(resampled_times)
276-
ori2res = np.array([
277-
np.abs(resampled_times - orig_time).argmin() if min_time <= orig_time <= max_time else None
278-
for orig_time in times
279-
])
276+
ori2res = np.array(
277+
[
278+
np.abs(resampled_times - orig_time).argmin() if min_time <= orig_time <= max_time else None
279+
for orig_time in times
280+
]
281+
)
280282

281283
# find NaNs that start or end a time-series
282284
row_nans, col_nans = np.where(self._get_start_end_nans(data))

eolearn/io/sentinelhub_process.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Input tasks that collect data from `Sentinel-Hub Process API
1+
"""Input tasks that collect data from `Sentinel-Hub Process API
22
<https://docs.sentinel-hub.com/api/latest/api/process/>`__
33
44
Copyright (c) 2017- Sinergise and contributors

eolearn/visualization/eoexecutor.py

+11-9
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,17 @@ def _get_node_descriptions(self) -> list[dict[str, Any]]:
163163
f" usually {np.mean(durations):.4g} ± {np.std(durations):.4g} seconds"
164164
)
165165

166-
descriptions.append({
167-
"name": f"{node_name} ({node.uid})",
168-
"uid": node.uid,
169-
"args": {
170-
key: value.replace("<", "&lt;").replace(">", "&gt;") # type: ignore[attr-defined]
171-
for key, value in node.task.private_task_config.init_args.items()
172-
},
173-
"duration_report": duration_report,
174-
})
166+
descriptions.append(
167+
{
168+
"name": f"{node_name} ({node.uid})",
169+
"uid": node.uid,
170+
"args": {
171+
key: value.replace("<", "&lt;").replace(">", "&gt;") # type: ignore[attr-defined]
172+
for key, value in node.task.private_task_config.init_args.items()
173+
},
174+
"duration_report": duration_report,
175+
}
176+
)
175177
return descriptions
176178

177179
def _render_execution_tracebacks(self, formatter: pygments.formatter.Formatter) -> list:

examples/core/CoreOverview.ipynb

+7-5
Original file line numberDiff line numberDiff line change
@@ -801,11 +801,13 @@
801801
}
802802
],
803803
"source": [
804-
"results = workflow.execute({\n",
805-
" load_node: {\"eopatch_folder\": \"TestEOPatch\"},\n",
806-
" add_feature_node: {\"data\": np.zeros((68, 3), dtype=np.uint8)},\n",
807-
" save_node: {\"eopatch_folder\": \"WorkflowEOPatch\"},\n",
808-
"})\n",
804+
"results = workflow.execute(\n",
805+
" {\n",
806+
" load_node: {\"eopatch_folder\": \"TestEOPatch\"},\n",
807+
" add_feature_node: {\"data\": np.zeros((68, 3), dtype=np.uint8)},\n",
808+
" save_node: {\"eopatch_folder\": \"WorkflowEOPatch\"},\n",
809+
" }\n",
810+
")\n",
809811
"\n",
810812
"results"
811813
]

examples/io/SentinelHubIO.ipynb

+6-4
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,12 @@
374374
"workflow_nodes = linearly_connect_tasks(input_task, add_indices, add_l2a_and_scl, add_dem, save, output_task)\n",
375375
"workflow = EOWorkflow(workflow_nodes)\n",
376376
"\n",
377-
"result = workflow.execute({\n",
378-
" workflow_nodes[0]: {\"bbox\": roi_bbox, \"time_interval\": time_interval},\n",
379-
" workflow_nodes[-2]: {\"eopatch_folder\": \"eopatch\"},\n",
380-
"})"
377+
"result = workflow.execute(\n",
378+
" {\n",
379+
" workflow_nodes[0]: {\"bbox\": roi_bbox, \"time_interval\": time_interval},\n",
380+
" workflow_nodes[-2]: {\"eopatch_folder\": \"eopatch\"},\n",
381+
" }\n",
382+
")"
381383
]
382384
},
383385
{

examples/land-cover-map/SI_LULC_pipeline.ipynb

+20-14
Original file line numberDiff line numberDiff line change
@@ -744,10 +744,12 @@
744744
"save_node = workflow_nodes[-1]\n",
745745
"execution_args = []\n",
746746
"for idx, bbox in enumerate(bbox_list[patch_ids]):\n",
747-
" execution_args.append({\n",
748-
" input_node: {\"bbox\": bbox, \"time_interval\": time_interval},\n",
749-
" save_node: {\"eopatch_folder\": f\"eopatch_{idx}\"},\n",
750-
" })\n",
747+
" execution_args.append(\n",
748+
" {\n",
749+
" input_node: {\"bbox\": bbox, \"time_interval\": time_interval},\n",
750+
" save_node: {\"eopatch_folder\": f\"eopatch_{idx}\"},\n",
751+
" }\n",
752+
" )\n",
751753
"\n",
752754
"# Execute the workflow\n",
753755
"executor = EOExecutor(workflow, execution_args, save_logs=True)\n",
@@ -1329,11 +1331,13 @@
13291331
"\n",
13301332
"execution_args = []\n",
13311333
"for idx in range(len(patch_ids)):\n",
1332-
" execution_args.append({\n",
1333-
" workflow_nodes[0]: {\"eopatch_folder\": f\"eopatch_{idx}\"}, # load\n",
1334-
" workflow_nodes[-2]: {\"seed\": 42}, # sampling\n",
1335-
" workflow_nodes[-1]: {\"eopatch_folder\": f\"eopatch_{idx}\"}, # save\n",
1336-
" })\n",
1334+
" execution_args.append(\n",
1335+
" {\n",
1336+
" workflow_nodes[0]: {\"eopatch_folder\": f\"eopatch_{idx}\"}, # load\n",
1337+
" workflow_nodes[-2]: {\"seed\": 42}, # sampling\n",
1338+
" workflow_nodes[-1]: {\"eopatch_folder\": f\"eopatch_{idx}\"}, # save\n",
1339+
" }\n",
1340+
" )\n",
13371341
"\n",
13381342
"executor = EOExecutor(workflow, execution_args, save_logs=True)\n",
13391343
"executor.run(workers=5)\n",
@@ -2002,11 +2006,13 @@
20022006
"# Create a list of execution arguments for each patch\n",
20032007
"execution_args = []\n",
20042008
"for i in range(len(patch_ids)):\n",
2005-
" execution_args.append({\n",
2006-
" workflow_nodes[0]: {\"eopatch_folder\": f\"eopatch_{i}\"},\n",
2007-
" workflow_nodes[2]: {\"filename\": f\"{tiff_location}/prediction_eopatch_{i}.tiff\"},\n",
2008-
" workflow_nodes[3]: {\"eopatch_folder\": f\"eopatch_{i}\"},\n",
2009-
" })\n",
2009+
" execution_args.append(\n",
2010+
" {\n",
2011+
" workflow_nodes[0]: {\"eopatch_folder\": f\"eopatch_{i}\"},\n",
2012+
" workflow_nodes[2]: {\"filename\": f\"{tiff_location}/prediction_eopatch_{i}.tiff\"},\n",
2013+
" workflow_nodes[3]: {\"eopatch_folder\": f\"eopatch_{i}\"},\n",
2014+
" }\n",
2015+
" )\n",
20102016
"\n",
20112017
"# Run the executor\n",
20122018
"executor = EOExecutor(workflow, execution_args)\n",

examples/water-monitor/WaterMonitorWorkflow.ipynb

+5-3
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,11 @@
430430
"# The download task requires additional arguments at execution. These are linked to the node the task is in.\n",
431431
"download_node = workflow_nodes[0]\n",
432432
"\n",
433-
"result = workflow.execute({\n",
434-
" download_node: {\"bbox\": dam_bbox, \"time_interval\": time_interval},\n",
435-
"})"
433+
"result = workflow.execute(\n",
434+
" {\n",
435+
" download_node: {\"bbox\": dam_bbox, \"time_interval\": time_interval},\n",
436+
" }\n",
437+
")"
436438
]
437439
},
438440
{

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,18 @@ docs = [
7272
"jupyter",
7373
"nbsphinx",
7474
"sphinx==7.1.2",
75-
"sphinx_mdinclude",
75+
"sphinx_mdinclude==0.5.4", #0.6 didn't work last time
7676
"sphinx_rtd_theme==1.3.0",
7777
]
7878
dev = [
7979
"build",
8080
"eo-learn[FULL]",
8181
"hypothesis",
82-
"moto",
82+
"moto[s3]>=5.0.0",
8383
"mypy>=0.990",
8484
"pylint>=2.14.0",
8585
"pytest>=7.0.0",
8686
"pytest-cov",
87-
"pytest-lazy-fixture",
8887
"pytest-mock",
8988
"twine",
9089
"types-python-dateutil",

tests/core/conftest.py

-27
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,8 @@
1010
from __future__ import annotations
1111

1212
import os
13-
from typing import Callable
1413

15-
import boto3
1614
import pytest
17-
from fs_s3fs import S3FS
18-
from moto import mock_s3
1915

2016
from eolearn.core import EOPatch
2117

@@ -28,26 +24,3 @@ def test_eopatch_path_fixture() -> str:
2824
@pytest.fixture(name="test_eopatch")
2925
def test_eopatch_fixture(test_eopatch_path) -> EOPatch:
3026
return EOPatch.load(test_eopatch_path)
31-
32-
33-
@pytest.fixture(name="create_mocked_s3fs", scope="session")
34-
def s3_mocking_fixture() -> Callable[[str], S3FS]:
35-
"""Provides a function for mocking S3 buckets"""
36-
37-
@mock_s3
38-
def create_mocked_s3fs(bucket_name: str = "mocked-test-bucket") -> S3FS:
39-
"""Creates a new empty mocked s3 bucket. If one such bucket already exists it deletes it first."""
40-
s3resource = boto3.resource("s3", region_name="eu-central-1")
41-
42-
bucket = s3resource.Bucket(bucket_name)
43-
44-
if bucket.creation_date: # If bucket already exists
45-
for key in bucket.objects.all():
46-
key.delete()
47-
bucket.delete()
48-
49-
s3resource.create_bucket(Bucket=bucket_name, CreateBucketConfiguration={"LocationConstraint": "eu-central-1"})
50-
51-
return S3FS(bucket_name=bucket_name)
52-
53-
return create_mocked_s3fs

tests/core/test_core_tasks.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,15 @@
5454

5555
@pytest.fixture(name="patch")
5656
def patch_fixture() -> EOPatch:
57-
patch = generate_eopatch({
58-
FeatureType.DATA: ["bands", "CLP"],
59-
FeatureType.MASK: ["CLM"],
60-
FeatureType.MASK_TIMELESS: ["mask", "LULC", "RANDOM_UINT8"],
61-
FeatureType.SCALAR: ["values", "CLOUD_COVERAGE"],
62-
FeatureType.META_INFO: ["something"],
63-
})
57+
patch = generate_eopatch(
58+
{
59+
FeatureType.DATA: ["bands", "CLP"],
60+
FeatureType.MASK: ["CLM"],
61+
FeatureType.MASK_TIMELESS: ["mask", "LULC", "RANDOM_UINT8"],
62+
FeatureType.SCALAR: ["values", "CLOUD_COVERAGE"],
63+
FeatureType.META_INFO: ["something"],
64+
}
65+
)
6466
patch.data["CLP_S2C"] = np.zeros_like(patch.data["CLP"])
6567
return patch
6668

0 commit comments

Comments
 (0)