| 231 | @pytest.mark.parametrize("m", window_size) |
| 232 | @pytest.mark.parametrize("percentages", percentages) |
| 233 | def test_scrump_self_join_larger_window(T_A, T_B, m, percentages): |
| 234 | if len(T_B) > m: |
| 235 | zone = int(np.ceil(m / 4)) |
| 236 | |
| 237 | for percentage in percentages: |
| 238 | seed = np.random.randint(100000) |
| 239 | |
| 240 | np.random.seed(seed) |
| 241 | ref_P, ref_I, ref_left_I, ref_right_I = naive.scrump( |
| 242 | T_B, m, T_B, percentage, zone, False, None |
| 243 | ) |
| 244 | |
| 245 | np.random.seed(seed) |
| 246 | approx = scrump( |
| 247 | T_B, m, ignore_trivial=True, percentage=percentage, pre_scrump=False |
| 248 | ) |
| 249 | approx.update() |
| 250 | comp_P = approx.P_ |
| 251 | comp_I = approx.I_ |
| 252 | comp_left_I = approx.left_I_ |
| 253 | comp_right_I = approx.right_I_ |
| 254 | |
| 255 | naive.replace_inf(ref_P) |
| 256 | naive.replace_inf(comp_P) |
| 257 | |
| 258 | npt.assert_almost_equal(ref_P, comp_P) |
| 259 | npt.assert_almost_equal(ref_I, comp_I) |
| 260 | npt.assert_almost_equal(ref_left_I, comp_left_I) |
| 261 | npt.assert_almost_equal(ref_right_I, comp_right_I) |
| 262 | |
| 263 | |
| 264 | @pytest.mark.parametrize("T_A, T_B", test_data) |