From 868dda8dca41de27434c63e773f1367a14ed0846 Mon Sep 17 00:00:00 2001 From: sgoodm Date: Sat, 5 Dec 2026 10:09:29 -0500 Subject: [PATCH] Remove dead pixel_count fallback that called nonexistent .items() --- src/rasterstats/main.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/rasterstats/main.py b/src/rasterstats/main.py index 59d2454..5ce86c1 100644 --- a/src/rasterstats/main.py +++ b/src/rasterstats/main.py @@ -255,17 +255,9 @@ def gen_zonal_stats( else: if run_count: keys, counts = np.unique(masked.compressed(), return_counts=True) - try: - pixel_count = dict( - zip([k.item() for k in keys], [c.item() for c in counts]) - ) - except AttributeError: - pixel_count = dict( - zip( - [k.items() for k in keys], - [c.items() for c in counts], - ) - ) + pixel_count = dict( + zip([k.item() for k in keys], [c.item() for c in counts]) + ) if categorical: feature_stats = dict(pixel_count)