From af67986e5bdc2aedc75ef21b1489af4fd8e38de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Mon, 3 Jun 2024 21:55:37 +0200 Subject: [PATCH 1/5] do not overwrite GDAL_CACHEMAX if set --- terracotta/scripts/optimize_rasters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terracotta/scripts/optimize_rasters.py b/terracotta/scripts/optimize_rasters.py index 32c7e707..70a4876e 100644 --- a/terracotta/scripts/optimize_rasters.py +++ b/terracotta/scripts/optimize_rasters.py @@ -32,7 +32,7 @@ IN_MEMORY_THRESHOLD = 10980 * 10980 -CACHEMAX = 1024 * 1024 * 512 # 512 MB +CACHEMAX = os.environ.get("GDAL_CACHEMAX", 1024 * 1024 * 512) # 512 MB GDAL_CONFIG = { "GDAL_TIFF_INTERNAL_MASK": True, From 4290edfc5a659f8e385efb7edd19d697e54047d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Tue, 4 Jun 2024 11:47:38 +0200 Subject: [PATCH 2/5] try updating miniconda action --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 45deacd4..04d2ab55 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -144,7 +144,7 @@ jobs: key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ hashFiles('environment.yml') }} - - uses: conda-incubator/setup-miniconda@v2 + - uses: conda-incubator/setup-miniconda@v3 with: python-version: ${{ matrix.python-version }} environment-file: environment.yml From b8a1b5321239921382ac208d90a8141584393dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Tue, 4 Jun 2024 12:22:47 +0200 Subject: [PATCH 3/5] use newer mpl.colormaps object --- terracotta/cmaps/generate_cmaps.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/terracotta/cmaps/generate_cmaps.py b/terracotta/cmaps/generate_cmaps.py index b5ad4992..7d10fd1a 100644 --- a/terracotta/cmaps/generate_cmaps.py +++ b/terracotta/cmaps/generate_cmaps.py @@ -4,11 +4,11 @@ """ import numpy as np -import matplotlib.cm as cm +import matploblib as mpl from terracotta.cmaps.get_cmaps import SUFFIX -ALL_CMAPS = list(cm.cmaps_listed) + list(cm.datad) +ALL_CMAPS = list(mpl.colormaps) ALL_CMAPS.extend([f"{cmap}_r" for cmap in ALL_CMAPS]) NUM_VALS = 255 @@ -17,7 +17,7 @@ def generate_maps(out_folder: str) -> None: x = np.linspace(0, 1, NUM_VALS) for cmap in ALL_CMAPS: print(cmap) - cmap_fun = cm.get_cmap(cmap) + cmap_fun = mpl.colormaps[cmap] cmap_vals = cmap_fun(x) cmap_uint8 = (cmap_vals * 255).astype("uint8") np.save(f"{out_folder}/{cmap.lower()}{SUFFIX}", cmap_uint8) From 86c68fc22ee4c5b2781e24ec6d335c6e260305a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Tue, 4 Jun 2024 12:32:54 +0200 Subject: [PATCH 4/5] typo --- terracotta/cmaps/generate_cmaps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terracotta/cmaps/generate_cmaps.py b/terracotta/cmaps/generate_cmaps.py index 7d10fd1a..92e02729 100644 --- a/terracotta/cmaps/generate_cmaps.py +++ b/terracotta/cmaps/generate_cmaps.py @@ -4,7 +4,7 @@ """ import numpy as np -import matploblib as mpl +import matplotlib as mpl from terracotta.cmaps.get_cmaps import SUFFIX From c3aede6ebdefa56fc1d129ce6016b926eba05fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dion=20H=C3=A4fner?= Date: Tue, 4 Jun 2024 14:15:19 +0200 Subject: [PATCH 5/5] remove extra _r cmaps --- terracotta/cmaps/generate_cmaps.py | 1 - 1 file changed, 1 deletion(-) diff --git a/terracotta/cmaps/generate_cmaps.py b/terracotta/cmaps/generate_cmaps.py index 92e02729..8556f2ad 100644 --- a/terracotta/cmaps/generate_cmaps.py +++ b/terracotta/cmaps/generate_cmaps.py @@ -9,7 +9,6 @@ from terracotta.cmaps.get_cmaps import SUFFIX ALL_CMAPS = list(mpl.colormaps) -ALL_CMAPS.extend([f"{cmap}_r" for cmap in ALL_CMAPS]) NUM_VALS = 255