Skip to content

Commit eca3aae

Browse files
authored
Bump version to 1.4.2 (#671)
* tdigest fixes * add changelog * bump version to 1.4.2 * update types of tdigest
1 parent 1ef8d73 commit eca3aae

File tree

11 files changed

+48
-23
lines changed

11 files changed

+48
-23
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## [Version 1.4.2] - 2023-3-14
2+
3+
- Introduced support for Python 3.11.
4+
- Removed support for Python 3.7.
5+
- Added T-Digest `EOTask` in the scope of the Global Earth Monitor Project, contributed by @meengel.
6+
- Used evalscript generation utility from `sentinelhub-py` in SH related `EOTasks`.
7+
- Deprecated the `EOPatch.merge` method and extracted it as a function.
8+
- Deprecated the `OVERWRITE_PATCH` permission and enforcing the usage of explicit string permissions.
9+
- Encapsulated `FeatureDict` class as `Mapping`, removed inheritance from `dict`.
10+
- Switched to new-style typed annotations.
11+
- Introduced the `ruff` python linter, removed `flake8` and `isort` (covered by `ruff`).
12+
- Fixed issue with occasionally failing scheduled builds on the `master` branch.
13+
- Various refactoring efforts and dependency improvements.
14+
- Various improvements to tests and code.
15+
116
## [Version 1.4.1] - 2023-3-14
217

318
- The codebase is now fully annotated and type annotations are mandatory for all new code.

core/eolearn/core/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
from .utils.parallelize import execute_with_mp_lock, join_futures, join_futures_iter, parallelize
3434
from .utils.parsing import FeatureParser
3535

36-
__version__ = "1.4.1"
36+
__version__ = "1.4.2"

coregistration/eolearn/coregistration/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

55
from .coregistration import ECCRegistrationTask, get_gradient
66

7-
__version__ = "1.4.1"
7+
__version__ = "1.4.2"

features/eolearn/features/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@
3838
AddSpatioTemporalFeaturesTask,
3939
)
4040

41-
__version__ = "1.4.1"
41+
__version__ = "1.4.2"

geometry/eolearn/geometry/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
)
1212
from .transformations import RasterToVectorTask, VectorToRasterTask
1313

14-
__version__ = "1.4.1"
14+
__version__ = "1.4.2"

io/eolearn/io/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
get_available_timestamps,
1414
)
1515

16-
__version__ = "1.4.1"
16+
__version__ = "1.4.2"

mask/eolearn/mask/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
from .snow_mask import SnowMaskTask, TheiaSnowMaskTask
99
from .utils import resize_images
1010

11-
__version__ = "1.4.1"
11+
__version__ = "1.4.2"

ml_tools/eolearn/ml_tools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
from .sampling import BlockSamplingTask, FractionSamplingTask, GridSamplingTask, sample_by_values
66
from .train_test_split import TrainTestSplitTask
77

8-
__version__ = "1.4.1"
8+
__version__ = "1.4.2"

ml_tools/eolearn/ml_tools/tdigest.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
22
The module provides an EOTask for the computation of a T-Digest representation of an EOPatch.
3+
Requires installation of `eolearn.ml_tools[TDIGEST]`.
34
45
Copyright (c) 2017- Sinergise and contributors
56
For the full list of contributors, see the CREDITS file in the root directory of this source tree.
@@ -16,7 +17,7 @@
1617
from eolearn.core import EOPatch, EOTask, FeatureType
1718
from eolearn.core.types import FeatureSpec, FeaturesSpecification
1819

19-
ModeTypes = Literal["standard", "timewise", "monthly", "total"]
20+
ModeTypes = Union[Literal["standard", "timewise", "monthly", "total"], Callable]
2021

2122

2223
class TDigestTask(EOTask):
@@ -47,7 +48,7 @@ def __init__(
4748
* | `'total'` computes the total T-Digest representation of the whole feature accumulating all timestamps,
4849
| bands and pixels. Cannot be used with `pixelwise=True`.
4950
* | Callable computes the T-Digest representation defined by the processing function given as mode. Receives
50-
| the input_array of the feature, the timestamps, the shape and the pixelwise and filternan keywords as an input.
51+
| the input_array of the feature, timestamps, shape and pixelwise and filternan keywords as an input.
5152
:param pixelwise: Decider whether to compute the T-Digest representation accumulating pixels or per pixel.
5253
Cannot be used with `mode='total'`.
5354
:param filternan: Decider whether to filter out nan-values before computing the T-Digest.
@@ -83,8 +84,13 @@ def execute(self, eopatch: EOPatch) -> EOPatch:
8384
for in_feature_, out_feature_, shape in _looper(
8485
in_feature=self.in_feature, out_feature=self.out_feature, eopatch=eopatch
8586
):
86-
eopatch[out_feature_] = _processing_function.get(self.mode, self.mode)(
87-
input_array=eopatch[in_feature_], timestamps=eopatch.timestamps, shape=shape, pixelwise=self.pixelwise, filternan=self.filternan
87+
processing_func = self.mode if callable(self.mode) else _processing_function[self.mode]
88+
eopatch[out_feature_] = processing_func(
89+
input_array=eopatch[in_feature_],
90+
timestamps=eopatch.timestamps,
91+
shape=shape,
92+
pixelwise=self.pixelwise,
93+
filternan=self.filternan,
8894
)
8995

9096
return eopatch
@@ -120,7 +126,9 @@ def _looper(
120126
yield in_feature_, out_feature_, shape
121127

122128

123-
def _process_standard(input_array: np.ndarray, shape: np.ndarray, pixelwise: bool, filternan: bool, **_: Any) -> np.ndarray:
129+
def _process_standard(
130+
input_array: np.ndarray, shape: np.ndarray, pixelwise: bool, filternan: bool, **_: Any
131+
) -> np.ndarray:
124132
if pixelwise:
125133
array = np.empty(shape[-3:], dtype=object)
126134
for i, j, k in product(range(shape[-3]), range(shape[-2]), range(shape[-1])):
@@ -134,7 +142,9 @@ def _process_standard(input_array: np.ndarray, shape: np.ndarray, pixelwise: boo
134142
return array
135143

136144

137-
def _process_timewise(input_array: np.ndarray, shape: np.ndarray, pixelwise: bool, filternan: bool, **_: Any) -> np.ndarray:
145+
def _process_timewise(
146+
input_array: np.ndarray, shape: np.ndarray, pixelwise: bool, filternan: bool, **_: Any
147+
) -> np.ndarray:
138148
if pixelwise:
139149
array = np.empty(shape, dtype=object)
140150
for time_, i, j, k in product(range(shape[0]), range(shape[1]), range(shape[2]), range(shape[3])):

setup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def parse_requirements(file):
2121
setup(
2222
name="eo-learn",
2323
python_requires=">=3.8",
24-
version="1.4.1",
24+
version="1.4.2",
2525
description="Earth observation processing framework for machine learning in Python",
2626
long_description=get_long_description(),
2727
long_description_content_type="text/markdown",
@@ -38,14 +38,14 @@ def parse_requirements(file):
3838
packages=[],
3939
include_package_data=True,
4040
install_requires=[
41-
"eo-learn-core==1.4.1",
42-
"eo-learn-coregistration==1.4.1",
43-
"eo-learn-features==1.4.1",
44-
"eo-learn-geometry==1.4.1",
45-
"eo-learn-io==1.4.1",
46-
"eo-learn-mask==1.4.1",
47-
"eo-learn-ml-tools==1.4.1",
48-
"eo-learn-visualization==1.4.1",
41+
"eo-learn-core==1.4.2",
42+
"eo-learn-coregistration==1.4.2",
43+
"eo-learn-features==1.4.2",
44+
"eo-learn-geometry==1.4.2",
45+
"eo-learn-io==1.4.2",
46+
"eo-learn-mask==1.4.2",
47+
"eo-learn-ml-tools==1.4.2",
48+
"eo-learn-visualization==1.4.2",
4949
],
5050
extras_require={"DEV": parse_requirements("requirements-dev.txt")},
5151
zip_safe=False,

0 commit comments

Comments
 (0)