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 diff --git a/terracotta/cmaps/generate_cmaps.py b/terracotta/cmaps/generate_cmaps.py index b5ad4992..8556f2ad 100644 --- a/terracotta/cmaps/generate_cmaps.py +++ b/terracotta/cmaps/generate_cmaps.py @@ -4,12 +4,11 @@ """ import numpy as np -import matplotlib.cm as cm +import matplotlib as mpl from terracotta.cmaps.get_cmaps import SUFFIX -ALL_CMAPS = list(cm.cmaps_listed) + list(cm.datad) -ALL_CMAPS.extend([f"{cmap}_r" for cmap in ALL_CMAPS]) +ALL_CMAPS = list(mpl.colormaps) NUM_VALS = 255 @@ -17,7 +16,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) 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,