Skip to content

Commit

Permalink
FIX: Remove warning about Dask's lock and client
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-braun committed Nov 29, 2024
1 parent d30d5aa commit 44d9616
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 2 additions & 6 deletions eoreader/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 44d9616

Please sign in to comment.