fix(sonar): use np.nonzero for single-argument np.where (python:S6729)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
mARTin-B78 2026-10-06 11:41:35 +02:00
parent 9a542cd198
commit c0e892aaf8

View File

@ -2018,7 +2018,7 @@ def _snap_seed_once(coverage, seed: Sequence[int], blocked) -> list[int] | None:
# not its dilated footprint -- dilation only decides which # not its dilated footprint -- dilation only decides which
# solid patches count as one figure, it must not itself widen # solid patches count as one figure, it must not itself widen
# the box. # the box.
ys, xs = np.where(solid & (labels == best + 1)) ys, xs = np.nonzero(solid & (labels == best + 1))
if xs.size: if xs.size:
anchor = [int(xs.min()), int(ys.min()), int(xs.max()), int(ys.max())] anchor = [int(xs.min()), int(ys.min()), int(xs.max()), int(ys.max())]
# A bounding box is a rectangle, not the component's actual # A bounding box is a rectangle, not the component's actual