From 44d96160e06746990a812649cf8dcb54b8006eda Mon Sep 17 00:00:00 2001 From: BRAUN REMI Date: Fri, 29 Nov 2024 10:54:37 +0100 Subject: [PATCH] FIX: Remove warning about Dask's lock and client --- CHANGES.md | 3 ++- eoreader/utils.py | 8 ++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 850099b1..23d5f877 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -7,7 +7,8 @@ - FIX: Fixed PAZ Product Regex to properly indentify PAZ ST products as `PAZProduct` - by @guillemc23 - FIX: Fixed preprocessing graph paths in order to support relative paths in more complex environments or contexts - by @guillemc23 - FIX: Remove useless `_norm_diff` function `indices.py` -- FIX: Add a fallback in case `map-overlay.kml` is not readable for `Sentinel-1` data ([#180](https://github.com/sertit/eoreader/issues/180)) +- FIX: Add a fallback in case `map-overlay.kml` is not readable for `Sentinel-1` data ([#180](https://github.com/sertit/eoreader/discussions/180),[#182](https://github.com/sertit/eoreader/issues/182)) +- FIX: Remove warning about Dask's lock and client - DOC: Update `conf.py` (remove useless hunks and set Sphinx 7 as base) - DOC: Added the [PAZ product guide](https://earth.esa.int/eogateway/documents/20142/37627/PAZ-Image-Products-Guide.pdf) to the PAZ Product documentation instead of the TerraSAR-X one - by @guillemc23 diff --git a/eoreader/utils.py b/eoreader/utils.py index 2d7ea572..56bd11cd 100644 --- a/eoreader/utils.py +++ b/eoreader/utils.py @@ -230,16 +230,12 @@ def write(xds: xr.DataArray, filepath: AnyPathStrType, **kwargs) -> None: filepath (AnyPathStrType): Path where to save it (directories should be existing) **kwargs: Overloading metadata, ie :code:`nodata=255` or :code:`dtype=np.uint8` """ - # TODO: remove this with sertit > 1.41.0 - # Prune empty kwargs to avoid throwing GDAL warnings/errors - kwargs = {k: v for k, v in kwargs.items() if v is not None} - lock = None if use_dask(): - from distributed import Lock, get_client + from distributed import Lock try: - lock = Lock("rio", client=get_client()) + lock = Lock("rio") except ValueError: pass