From c0e892aaf8d790f4c6691749668df5b26f196bc2 Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Tue, 6 Oct 2026 11:41:35 +0200 Subject: [PATCH] fix(sonar): use np.nonzero for single-argument np.where (python:S6729) Co-Authored-By: Claude Sonnet 5.5 --- core/magazine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/magazine.py b/core/magazine.py index e80c501..ea8cc07 100644 --- a/core/magazine.py +++ b/core/magazine.py @@ -2018,7 +2018,7 @@ def _snap_seed_once(coverage, seed: Sequence[int], blocked) -> list[int] | None: # not its dilated footprint -- dilation only decides which # solid patches count as one figure, it must not itself widen # the box. - ys, xs = np.where(solid & (labels == best + 1)) + ys, xs = np.nonzero(solid & (labels == best + 1)) if xs.size: anchor = [int(xs.min()), int(ys.min()), int(xs.max()), int(ys.max())] # A bounding box is a rectangle, not the component's actual