(T, ray_cluster)
| 176 | @pytest.mark.filterwarnings("ignore:\\s+Port 8787 is already in use:UserWarning") |
| 177 | @pytest.mark.parametrize("T", T) |
| 178 | def test_aamp_stimped_ray(T, ray_cluster): |
| 179 | if not RAY_IMPORTED: # pragma: no cover |
| 180 | pytest.skip("Skipping Test Ray Not Installed") |
| 181 | |
| 182 | threshold = 0.2 |
| 183 | min_m = 3 |
| 184 | n = T.shape[0] - min_m + 1 |
| 185 | |
| 186 | pan = aamp_stimped( |
| 187 | ray, |
| 188 | T, |
| 189 | min_m=min_m, |
| 190 | max_m=None, |
| 191 | step=1, |
| 192 | ) |
| 193 | |
| 194 | for i in range(n): |
| 195 | pan.update() |
| 196 | |
| 197 | ref_PAN = np.full((pan.M_.shape[0], T.shape[0]), fill_value=np.inf) |
| 198 | |
| 199 | for idx, m in enumerate(pan.M_[:n]): |
| 200 | zone = int(np.ceil(m / 4)) |
| 201 | ref_mp = naive.aamp(T, m, T_B=None, exclusion_zone=zone) |
| 202 | ref_PAN[pan._bfs_indices[idx], : ref_mp.shape[0]] = ref_mp[:, 0] |
| 203 | |
| 204 | # Compare raw pan |
| 205 | cmp_PAN = pan._PAN |
| 206 | |
| 207 | naive.replace_inf(ref_PAN) |
| 208 | naive.replace_inf(cmp_PAN) |
| 209 | |
| 210 | npt.assert_almost_equal(ref_PAN, cmp_PAN) |
| 211 | |
| 212 | # Compare transformed pan |
| 213 | cmp_pan = pan.PAN_ |
| 214 | ref_pan = naive.transform_pan( |
| 215 | pan._PAN, |
| 216 | pan._M, |
| 217 | threshold, |
| 218 | pan._bfs_indices, |
| 219 | pan._n_processed, |
| 220 | np.min(T), |
| 221 | np.max(T), |
| 222 | ) |
| 223 | |
| 224 | naive.replace_inf(ref_pan) |
| 225 | naive.replace_inf(cmp_pan) |
| 226 | |
| 227 | npt.assert_almost_equal(ref_pan, cmp_pan) |
nothing calls this directly
no test coverage detected