Skip to content

Commit

Permalink
Prepare for release, adjust extras (#750)
Browse files Browse the repository at this point in the history
* simplify extras

* update version

* correct error messages

* add changelog info
  • Loading branch information
zigaLuksic authored Sep 6, 2023
1 parent a5df49d commit eddd6cb
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 26 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## [Version 1.5.0] - 2023-09-06

The release focuses on making `eo-learn` much simpler to install, reducing the number of dependencies, and improving validation of soundness of `EOPatch` data.

- `eo-learn` is now distributed as a single package. Installation of `eo-learn-mask` and similar is no longer necessary and users are warned when such installations are detected.
- Changes to `timestamps` and `bbox` attributes of `EOPatch` objects:
- `FeatureType.TIMESTAMPS` and `FeatureType.BBOX` have been deprecated, data should be accessed via attributes. Feature parsers no longer return these values (for instance when calling `EOPatch.get_features`).
- EOPatches without temporal information now have a timestamp value of `None`, whereas a timestamp value `[]` signifies that the EOPatch has a temporal dimension of 0.
- Introduced a `get_timestamps` method that will fail if `timestamps` are `None`. This can be used in cases where timestamps are assumed to be present (to avoid issues with type-checking and ill formed inputs).
- Loading, saving, and copying of EOPatches will take `timestamps` into account either when processing the full eopatch (i.e. `features=...`) or if the selection contains a temporal feature. The behavior can be controlled via the `load_timestamps`/`save_timestamps`/`copy_timestamps` parameter.
- Saving and loading of `FeatureType.META_INFO` now processes each feature as a separate file, allowing better filtering and preventing accidental overwriting.
- The default backend for `SpatialResizeTask` has been switched to `cv2` to reduce the number of dependencies.
- `eolearn.geometry.morphology` tasks now use `cv2` instead of `scikit-image` to reduce the number of dependencies. The task interfaces have been slightly adjusted.
- Improved reports:
- Exception grouping is now done by exception origin instead of exception message, resulting in shorter reports.
- Added execution time statistics per node
- `CloudMaskTask` has been restricted to mono-temporal predictions using the `s2cloudless` package. For the multi-temporal one check [here](https://github.com/sentinel-hub/eo-learn-examples/blob/main/extra-tasks/cloud_mask/cloud_mask.py).
- Certain tasks (for instance `SaveTask` and `LoadTask`) no longer pass arguments to the super-class via **kwargs in order to improve documentation and type-checking.
- `SaveTask` and `LoadTask` now raise `OSError` exceptions instead of `IOError`.
- Project-specific and outdated EOTasks were moved to extras or to the example repository [eo-learn-examples/extra-tasks](https://github.com/sentinel-hub/eo-learn-examples/tree/main/extra-tasks).
- The submodule `eolearn.features.bands_extraction` has been renamed to `eolearn.features.ndi`.
- The submodule `eolearn.ml_tools.extra.plotting` has been moved to `eolearn.visualization.utils`.
- Compression of EOPatch files has been hardcoded. The parameter `compression_level` has been deprecated and has no effect.
- Introduced experimental `zarr` support for loading/saving temporal slices of temporal features. The API might be changed in future releases.
- Limited `rasterio` to 1.3.7 due to an issue with importing rasters from AWS S3
- Updated examples, simplified tests, various improvements.


## [Version 1.4.2] - 2023-03-14

- Introduced support for Python 3.11.
Expand Down
2 changes: 1 addition & 1 deletion core/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eo-learn[ALL]
eo-learn
2 changes: 1 addition & 1 deletion coregistration/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eo-learn[ALL]
eo-learn
2 changes: 1 addition & 1 deletion eolearn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Main module of the `eolearn` package."""
__version__ = "1.4.2"
__version__ = "1.5.0"

import importlib.util
import warnings
Expand Down
2 changes: 1 addition & 1 deletion eolearn/core/eodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ def plot(
from eolearn.visualization.eopatch import plot_eopatch
except ImportError:
raise RuntimeError(
"Subpackage eo-learn-visualization has to be installed in order to use EOPatch visualization method"
"Dependencies `eo-learn[VISUALIZATION]` have to be installed in order to use EOPatch plotting."
)

return plot_eopatch(
Expand Down
2 changes: 1 addition & 1 deletion eolearn/core/eoexecution.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def make_report(self, include_logs: bool = True) -> None:
from eolearn.visualization.eoexecutor import EOExecutorVisualization
except ImportError:
raise RuntimeError(
"Subpackage eo-learn-visualization has to be installed in order to create EOExecutor reports."
"Dependencies `eo-learn[VISUALIZATION]` have to be installed in order to create EOExecutor reports."
)

return EOExecutorVisualization(self).make_report(include_logs=include_logs)
Expand Down
2 changes: 1 addition & 1 deletion eolearn/core/eoworkflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def _get_visualization(self): # type: ignore[no-untyped-def] # cannot type with
from eolearn.visualization.eoworkflow import EOWorkflowVisualization
except ImportError:
raise RuntimeError(
"Subpackage eo-learn-visualization has to be installed in order to use EOWorkflow visualization methods"
"Dependencies `eo-learn[VISUALIZATION]` have to be installed in order to use EOWorkflow visualization."
)
return EOWorkflowVisualization(self._nodes)

Expand Down
4 changes: 2 additions & 2 deletions examples/visualization/EOPatchVisualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"source": [
"## Basics\n",
"\n",
"All visualizations can be done simply by calling `EOPatch.plot` method, however calling this method still requires that `eo-learn-visualization` subpackage is installed.\n",
"All visualizations can be done simply by calling `EOPatch.plot` method, however calling this method still requires that Dependencies `eo-learn[VISUALIZATION]` are installed.\n",
"\n",
"Plotting a simple timeless single-channel feature produces a single-image plot. Plotting method always returns a 2D grid of `AxesSubplot` objects which can be further customized before a plot is produced."
]
Expand Down Expand Up @@ -342,7 +342,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.8.10"
},
"vscode": {
"interpreter": {
Expand Down
2 changes: 1 addition & 1 deletion features/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eo-learn[ALL]
eo-learn
2 changes: 1 addition & 1 deletion geometry/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eo-learn[ALL]
eo-learn
2 changes: 1 addition & 1 deletion install_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
subprocess.check_call([sys.executable, "-m", "pip", "install", *sys.argv[1:], ".[ALL]"])
warnings.warn(
"Installing via `install_all.py` is no longer necessary and has been deprecated. Use `pip install"
" eo-learn[ALL]` instead."
" eo-learn` instead."
)
2 changes: 1 addition & 1 deletion io/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eo-learn[ALL]
eo-learn
2 changes: 1 addition & 1 deletion mask/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eo-learn[ALL]
eo-learn
2 changes: 1 addition & 1 deletion ml_tools/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eo-learn[ALL]
eo-learn
19 changes: 8 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,23 @@ dependencies = [
"sentinelhub>=3.9.0",
"tqdm>=4.27",
"typing-extensions",
"opencv-python-headless",
"affine",
"rasterio>=1.2.7, <1.3.8",
"shapely",
"fiona>=1.8.18",
]

[project.optional-dependencies]
all = [
"eo-learn[COREGISTRATION,FEATURES,GEOMETRY,IO,MASK,MLTOOLS,VISUALIZATION]",
]
full = ["eo-learn[ALL,RAY,ZARR,FEATURES_EXTRA,MASK_EXTRA]"]

full = ["eo-learn[RAY,ZARR,FEATURES_EXTRA,MASK_EXTRA,VISUALIZATION]"]
ray = ["ray[default]"]
zarr = ["s3fs", "zarr"]
coregistration = ["opencv-python-headless"]
features = ["opencv-python-headless"]
features_extra = ["numba>=0.53.0", "scikit-learn", "scipy"]
geometry = ["affine", "opencv-python-headless", "rasterio>=1.2.7, <1.3.8", "shapely"]
io = ["affine", "fiona>=1.8.18", "rasterio>=1.2.7, <1.3.8"]
mask = ["opencv-python-headless"]
mask_extra = ["s2cloudless"]
mltools = ["shapely"]
visualization = ["graphviz>=0.10.1", "jinja2", "matplotlib", "pygments"]
docs = [
"eo-learn[ALL]",
"eo-learn[FULL]",
"jupyter",
"nbsphinx",
"sphinx==7.1.2",
Expand Down
2 changes: 1 addition & 1 deletion visualization/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eo-learn[ALL]
eo-learn

0 comments on commit eddd6cb

Please sign in to comment.