From b8078806d85d034a95802bea54ae382ee443d406 Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Wed, 15 Jul 2026 10:28:35 -0400 Subject: [PATCH] fix(utils): correct nomask check in take_looks `take_looks` guarded the masked-input path with `arr.mask.ndim == np.ma.nomask`, comparing an int (`ndim`) against the `nomask` sentinel (which is `np.False_`) -- so the branch never behaved as intended. Use the identity check `arr.mask is np.ma.nomask`. Co-Authored-By: Claude Opus 4.8 --- src/dolphin/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dolphin/utils.py b/src/dolphin/utils.py index b6f5e306..76a1b9a6 100644 --- a/src/dolphin/utils.py +++ b/src/dolphin/utils.py @@ -223,7 +223,7 @@ def take_looks(arr, row_looks, col_looks, func_type="nansum", edge_strategy="cut func_type=func_type, edge_strategy=edge_strategy, ) - if arr.mask.ndim == np.ma.nomask: + if arr.mask is np.ma.nomask: looked_mask = arr.mask else: looked_mask = take_looks(