Test annotation sorting.
()
| 1358 | |
| 1359 | |
| 1360 | def test_sorting(): |
| 1361 | """Test annotation sorting.""" |
| 1362 | annot = Annotations([10, 20, 30], [1, 2, 3], "BAD") |
| 1363 | # assert_array_equal(annot.onset, [0, 5, 10]) |
| 1364 | annot.append([5, 15, 25, 35], 0.5, "BAD") |
| 1365 | onset = list(range(5, 36, 5)) |
| 1366 | duration = list(annot.duration) |
| 1367 | assert_array_equal(annot.onset, onset) |
| 1368 | assert_array_equal(annot.duration, duration) |
| 1369 | annot.append([10, 10], [0.1, 9], "BAD") # 0.1 should be before, 9 after |
| 1370 | want_before = onset.index(10) |
| 1371 | duration.insert(want_before, 0.1) |
| 1372 | duration.insert(want_before + 2, 9) |
| 1373 | onset.insert(want_before, 10) |
| 1374 | onset.insert(want_before, 10) |
| 1375 | assert_array_equal(annot.onset, onset) |
| 1376 | assert_array_equal(annot.duration, duration) |
| 1377 | |
| 1378 | |
| 1379 | def test_date_none(tmp_path): |
nothing calls this directly
no test coverage detected