diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4751b429..1948c24e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,18 +13,18 @@ repos: - id: debug-statements - repo: https://github.com/psf/black - rev: 23.11.0 + rev: 23.12.1 hooks: - id: black language_version: python3 - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.1.5" + rev: "v0.1.11" hooks: - id: ruff - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.0 + rev: 1.7.1 hooks: - id: nbqa-black - id: nbqa-ruff diff --git a/CHANGELOG.md b/CHANGELOG.md index e93f75a7..ba43ba9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [Version 1.5.3] - 2024-01-10 + +- Fix `numpy<2` in anticipation of numpy 2.0 release. + + ## [Version 1.5.2] - 2023-11-07 - `RayExecutor` can now forward remote kwargs to ray jobs. diff --git a/eolearn/__init__.py b/eolearn/__init__.py index 3e77f3bb..d32baa74 100644 --- a/eolearn/__init__.py +++ b/eolearn/__init__.py @@ -1,6 +1,6 @@ """Main module of the `eolearn` package.""" -__version__ = "1.5.2" +__version__ = "1.5.3" import importlib.util import warnings diff --git a/eolearn/core/eodata.py b/eolearn/core/eodata.py index 3e802f18..b694d022 100644 --- a/eolearn/core/eodata.py +++ b/eolearn/core/eodata.py @@ -445,9 +445,9 @@ def __repr__(self) -> str: content = self[feature_type] content = {k: content._get_unloaded(k) for k in content} # noqa: SLF001 - inner_content_repr = "\n ".join([ - f"{label}: {self._repr_value(value)}" for label, value in sorted(content.items()) - ]) + inner_content_repr = "\n ".join( + [f"{label}: {self._repr_value(value)}" for label, value in sorted(content.items())] + ) content_str = "{\n " + inner_content_repr + "\n }" feature_repr_list.append(f"{feature_type.value}={content_str}") diff --git a/examples/water-monitor/WaterMonitorWorkflow.ipynb b/examples/water-monitor/WaterMonitorWorkflow.ipynb index 7bc5d75f..bba14e02 100644 --- a/examples/water-monitor/WaterMonitorWorkflow.ipynb +++ b/examples/water-monitor/WaterMonitorWorkflow.ipynb @@ -356,9 +356,9 @@ " # we're only interested in the water within the dam borders\n", " water_masks = water_masks[..., np.newaxis] * eopatch.mask_timeless[\"NOMINAL_WATER\"]\n", "\n", - " water_levels = np.asarray([\n", - " np.count_nonzero(mask) / np.count_nonzero(eopatch.mask_timeless[\"NOMINAL_WATER\"]) for mask in water_masks\n", - " ])\n", + " water_levels = np.asarray(\n", + " [np.count_nonzero(mask) / np.count_nonzero(eopatch.mask_timeless[\"NOMINAL_WATER\"]) for mask in water_masks]\n", + " )\n", "\n", " eopatch[FeatureType.MASK, \"WATER_MASK\"] = water_masks\n", " eopatch[FeatureType.SCALAR, \"WATER_LEVEL\"] = water_levels[..., np.newaxis]\n", @@ -646,7 +646,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.4" + "version": "3.8.10" }, "vscode": { "interpreter": { diff --git a/tests/core/test_utils/test_common.py b/tests/core/test_utils/test_common.py index 0dd34332..1f878d52 100644 --- a/tests/core/test_utils/test_common.py +++ b/tests/core/test_utils/test_common.py @@ -98,9 +98,9 @@ class ApplyToAxesTestCase: function=partial(np.flip, axis=0), data=np.arange(2 * 3 * 4).reshape((2, 3, 4)), spatial_axes=(1, 2), - expected=np.array([ - [[8, 9, 10, 11], [4, 5, 6, 7], [0, 1, 2, 3]], [[20, 21, 22, 23], [16, 17, 18, 19], [12, 13, 14, 15]] - ]), + expected=np.array( + [[[8, 9, 10, 11], [4, 5, 6, 7], [0, 1, 2, 3]], [[20, 21, 22, 23], [16, 17, 18, 19], [12, 13, 14, 15]]] + ), ), ApplyToAxesTestCase( function=lambda x: x + 1,