()
| 555 | |
| 556 | |
| 557 | def test_multi_match_isconstant(): |
| 558 | T = np.random.rand(2, 64) |
| 559 | Q = np.random.rand(2, 8) |
| 560 | |
| 561 | m = Q.shape[-1] |
| 562 | excl_zone = int(np.ceil(m / 4)) |
| 563 | max_distance = 0.3 |
| 564 | |
| 565 | T_subseq_isconstant = functools.partial( |
| 566 | naive.isconstant_func_stddev_threshold, quantile_threshold=0.05 |
| 567 | ) |
| 568 | |
| 569 | Q_subseq_isconstant = np.array( |
| 570 | [ |
| 571 | [True], |
| 572 | [False], |
| 573 | ] |
| 574 | ) |
| 575 | |
| 576 | left = naive_multi_match( |
| 577 | Q, |
| 578 | T, |
| 579 | excl_zone, |
| 580 | max_distance=max_distance, |
| 581 | T_subseq_isconstant=T_subseq_isconstant, |
| 582 | Q_subseq_isconstant=Q_subseq_isconstant, |
| 583 | ) |
| 584 | |
| 585 | right = match( |
| 586 | Q, |
| 587 | T, |
| 588 | max_matches=None, |
| 589 | max_distance=lambda D: max_distance, # also test lambda functionality |
| 590 | T_subseq_isconstant=T_subseq_isconstant, |
| 591 | Q_subseq_isconstant=Q_subseq_isconstant, |
| 592 | ) |
| 593 | |
| 594 | npt.assert_almost_equal(left, right) |
| 595 | |
| 596 | |
| 597 | def test_motifs(): |
nothing calls this directly
no test coverage detected