MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / test_on_select_ignores_duplicate_hits

Function test_on_select_ignores_duplicate_hits

tests/utils/test_skeleton.py:228–248  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

226
227
228def test_on_select_ignores_duplicate_hits():
229 builder = make_test_builder()
230 builder.xy = np.array(
231 [
232 [0.0, 0.0],
233 [10.0, 0.0],
234 [20.0, 0.0],
235 ]
236 )
237 builder.tree = KDTree(builder.xy)
238 builder.inds = set()
239 builder.segs = set()
240 builder.lines = LineCollection([])
241 attach_fake_canvas(builder)
242
243 # Repeated nearby vertices should not create duplicate pairs
244 verts = [(0.0, 0.0), (0.1, 0.0), (10.0, 0.0), (10.1, 0.0), (20.0, 0.0)]
245 builder.on_select(verts)
246
247 assert builder.inds == {(0, 1), (1, 2)}
248 assert len(builder.segs) == 2
249
250
251# ---------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

make_test_builderFunction · 0.85
attach_fake_canvasFunction · 0.85
on_selectMethod · 0.45

Tested by

no test coverage detected