| 128 | |
| 129 | @pytest.mark.filterwarnings("ignore:\\s+Port 8787 is already in use:UserWarning") |
| 130 | def test_maamped_identical_subsequence_self_join(dask_cluster): |
| 131 | with Client(dask_cluster) as dask_client: |
| 132 | identical = np.random.rand(8) |
| 133 | T_A = np.random.rand(20) |
| 134 | T_A[1 : 1 + identical.shape[0]] = identical |
| 135 | T_A[11 : 11 + identical.shape[0]] = identical |
| 136 | T = np.array([T_A, T_A, np.random.rand(T_A.shape[0])]) |
| 137 | m = 3 |
| 138 | |
| 139 | excl_zone = int(np.ceil(m / 4)) |
| 140 | |
| 141 | ref_P, ref_I = naive.maamp(T, m, excl_zone) |
| 142 | comp_P, comp_I = maamped(dask_client, T, m) |
| 143 | |
| 144 | npt.assert_almost_equal( |
| 145 | ref_P, comp_P, decimal=config.STUMPY_TEST_PRECISION |
| 146 | ) # ignore indices |
| 147 | |
| 148 | |
| 149 | @pytest.mark.filterwarnings("ignore:\\s+Port 8787 is already in use:UserWarning") |