diff --git a/CHANGES.md b/CHANGES.md index 29e2b8e0..8bfeeee6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Release History +## 0.21.3 (2024-mm-dd) + +- FIX: Get better window name (if available) when writing bands on disk (in tmp folder) + ## 0.21.2 (2024-07-30) - ENH: `to_str` and `to_band`: add a `as_list` argument defaulting to `True`. When set as False, return a str from `to_str` and a band from `to_band` ([#138](https://github.com/sertit/eoreader/issues/138)). Thanks @jsetty! diff --git a/environment-doc.yml b/environment-doc.yml index 6384f67b..53fe054f 100644 --- a/environment-doc.yml +++ b/environment-doc.yml @@ -5,5 +5,4 @@ dependencies: # everything under this, installed by conda - python=3.9 - pip - pip: # everything under this, installed by pip - - --extra-index-url ${WINDOWS_WHEELS} # Use windows wheels on Windows - -r ./requirements-doc.txt diff --git a/eoreader/products/optical/optical_product.py b/eoreader/products/optical/optical_product.py index 19c66274..5896c7dc 100644 --- a/eoreader/products/optical/optical_product.py +++ b/eoreader/products/optical/optical_product.py @@ -656,11 +656,18 @@ def _get_clean_band_path( # Radiometric processing rad_proc = "" if kwargs.get(TO_REFLECTANCE, True) else "_as_is" - # Window + # Window name window = kwargs.get("window") - win_suffix = ( - f"win{files.hash_file_content(str(window))}_" if window is not None else "" - ) + + win_suffix = "" + if window is not None: + if path.is_path(window): + win_suffix = path.get_filename(window) + elif isinstance(window, gpd.GeoDataFrame): + win_suffix = window.attrs.get("name") + + if not win_suffix: + win_suffix = f"win{files.hash_file_content(str(window))}_" return self._get_band_folder(writable).joinpath( f"{self.condensed_name}_{band.name}_{res_str.replace('.', '-')}_{win_suffix}{cleaning_method.value}{rad_proc}.tif", diff --git a/requirements.txt b/requirements.txt index 916835a6..ab208dcb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -37,7 +37,7 @@ geopandas>=0.11.0 spyndex>=0.3.0 # SERTIT libs -sertit[full]>=1.39.1 +sertit[full]>=1.41.0 # Optimizations dask[complete]>=2021.10.0 diff --git a/setup.py b/setup.py index d2d8141f..889eda7a 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ "xarray>=0.18.0", "rioxarray>=0.10.0", "geopandas>=0.11.0", - "sertit[full]>=1.39.1", + "sertit[full]>=1.41.0", "spyndex>=0.3.0", "pyresample", "zarr",