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:
parent
9a542cd198
commit
c0e892aaf8
@ -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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user