| 183 | @pytest.mark.parametrize("T_A, T_B", test_data) |
| 184 | @pytest.mark.parametrize("percentages", percentages) |
| 185 | def test_scraamp_A_B_join_swap(T_A, T_B, percentages): |
| 186 | m = 3 |
| 187 | |
| 188 | for percentage in percentages: |
| 189 | seed = np.random.randint(100000) |
| 190 | |
| 191 | np.random.seed(seed) |
| 192 | ref_P, _, ref_left_I, ref_right_I = naive.scraamp( |
| 193 | T_B, m, T_A, percentage, None, False, None |
| 194 | ) |
| 195 | |
| 196 | np.random.seed(seed) |
| 197 | approx = scraamp( |
| 198 | T_B, m, T_A, ignore_trivial=False, percentage=percentage, pre_scraamp=False |
| 199 | ) |
| 200 | approx.update() |
| 201 | comp_P = approx.P_ |
| 202 | # comp_I = approx.I_ |
| 203 | comp_left_I = approx.left_I_ |
| 204 | comp_right_I = approx.right_I_ |
| 205 | |
| 206 | naive.replace_inf(ref_P) |
| 207 | naive.replace_inf(comp_P) |
| 208 | |
| 209 | npt.assert_almost_equal(ref_P, comp_P) |
| 210 | npt.assert_almost_equal(ref_P, comp_P) |
| 211 | npt.assert_almost_equal(ref_left_I, comp_left_I) |
| 212 | npt.assert_almost_equal(ref_right_I, comp_right_I) |
| 213 | |
| 214 | |
| 215 | @pytest.mark.parametrize("T_A, T_B", test_data) |