improve coverage

This commit is contained in:
2026-03-29 19:13:59 -07:00
parent 2b17a2594f
commit 29eee8a42c
12 changed files with 570 additions and 35 deletions

View File

@@ -23,14 +23,14 @@ def test_threshold_mask():
assert len(previews) == 1
assert previews[0].startswith("data:image/png;base64,")
mask_below, = node.process(field, method="absolute", threshold=0.5, direction="below")
mask_below, _ = node.process(field, method="absolute", threshold=0.5, direction="below")
assert np.all(mask_below[:, :32] == 255)
assert np.all(mask_below[:, 32:] == 0)
mask_rel, = node.process(field, method="relative", threshold=0.5, direction="above")
mask_rel, _ = node.process(field, method="relative", threshold=0.5, direction="above")
assert np.all(mask_rel[:, 32:] == 255)
mask_otsu, = node.process(field, method="otsu", threshold=0.0, direction="above")
mask_otsu, _ = node.process(field, method="otsu", threshold=0.0, direction="above")
assert mask_otsu[:, 32:].sum() > mask_otsu[:, :32].sum()
ThresholdMask._broadcast_fn = None