From 22760c6aa90390f4284be45adcd6bcea04951d25 Mon Sep 17 00:00:00 2001 From: serj90 Date: Thu, 14 Dec 2023 17:33:00 +0400 Subject: [PATCH 1/3] remove numpy version upper bound restriction --- setup.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.py b/setup.py index 79e1c112..c456bdd3 100644 --- a/setup.py +++ b/setup.py @@ -17,9 +17,6 @@ numpy_version = ">=1.15,!=1.17.0" -# TODO: remove when crick is updated -numpy_version += ",<1.24" - setup( # metadata name="terracotta", From ba8551010336d8bd3b75e16add22327471956e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Thu, 14 Dec 2023 15:30:27 +0100 Subject: [PATCH 2/3] avoid warning when converting images with nans --- terracotta/image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terracotta/image.py b/terracotta/image.py index 229f2c2a..ca62032c 100755 --- a/terracotta/image.py +++ b/terracotta/image.py @@ -156,6 +156,8 @@ def to_uint8(data: Array, lower_bound: Number, upper_bound: Number) -> Array: """Re-scale an array to [1, 255] and cast to uint8 (0 is used for transparency)""" rescaled = contrast_stretch(data, (lower_bound, upper_bound), (1, 255), clip=True) rescaled = np.rint(rescaled) + # explicitly set NaNs to 0 to avoid warnings + rescaled[~np.isfinite(rescaled)] = 0 return rescaled.astype(np.uint8) From a093c7688165500a4a3f07749cddf849ce4409d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Thu, 14 Dec 2023 15:47:29 +0100 Subject: [PATCH 3/3] install crick via pip in conda env --- environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index db275dc5..ed5c2531 100644 --- a/environment.yml +++ b/environment.yml @@ -7,7 +7,7 @@ dependencies: - numpy - rasterio>=1.3.0 - shapely - - crick - pip - pip: + - crick - -e .[recommended]