From fe7dfa26d1e2409bd6716a4b6332dacb876a3e53 Mon Sep 17 00:00:00 2001 From: juanrmn Date: Tue, 14 Oct 2025 16:46:34 +0200 Subject: [PATCH] bugfix variable not initialized --- raster_loader/io/common.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/raster_loader/io/common.py b/raster_loader/io/common.py index fb92037..15f2bda 100644 --- a/raster_loader/io/common.py +++ b/raster_loader/io/common.py @@ -637,10 +637,9 @@ def raster_band_stats( print("Removing masked data...") qdata = raster_band.compressed() - if basic_stats: - quantiles = None - most_common = None - else: + quantiles = None + most_common = None + if not basic_stats: casting_function = ( int if np.issubdtype(raster_band.dtype, np.integer) else float )