| 350 | |
| 351 | @pytest.mark.parametrize("T_A, T_B", test_data) |
| 352 | def test_scrump_A_B_join_full(T_A, T_B): |
| 353 | m = 3 |
| 354 | |
| 355 | ref_mp = naive.stump(T_A, m, T_B=T_B, row_wise=True) |
| 356 | ref_P = ref_mp[:, 0] |
| 357 | ref_I = ref_mp[:, 1] |
| 358 | ref_left_I = ref_mp[:, 2] |
| 359 | ref_right_I = ref_mp[:, 3] |
| 360 | |
| 361 | approx = scrump(T_A, m, T_B, ignore_trivial=False, percentage=1.0, pre_scrump=False) |
| 362 | approx.update() |
| 363 | comp_P = approx.P_ |
| 364 | comp_I = approx.I_ |
| 365 | comp_left_I = approx.left_I_ |
| 366 | comp_right_I = approx.right_I_ |
| 367 | |
| 368 | naive.replace_inf(ref_P) |
| 369 | naive.replace_inf(comp_P) |
| 370 | |
| 371 | npt.assert_almost_equal(ref_P, comp_P) |
| 372 | npt.assert_almost_equal(ref_I, comp_I) |
| 373 | npt.assert_almost_equal(ref_left_I, comp_left_I) |
| 374 | npt.assert_almost_equal(ref_right_I, comp_right_I) |
| 375 | |
| 376 | ref_mp = stump(T_A, m, T_B=T_B, ignore_trivial=False) |
| 377 | ref_P = ref_mp[:, 0] |
| 378 | ref_I = ref_mp[:, 1] |
| 379 | ref_left_I = ref_mp[:, 2] |
| 380 | ref_right_I = ref_mp[:, 3] |
| 381 | |
| 382 | npt.assert_almost_equal(ref_P, comp_P) |
| 383 | npt.assert_almost_equal(ref_I, comp_I) |
| 384 | npt.assert_almost_equal(ref_left_I, comp_left_I) |
| 385 | npt.assert_almost_equal(ref_right_I, comp_right_I) |
| 386 | |
| 387 | |
| 388 | @pytest.mark.parametrize("T_A, T_B", test_data) |