From 2799ad3a5cd2a9924a1f6712085e116e643dba53 Mon Sep 17 00:00:00 2001 From: Shing Zhan Date: Wed, 13 Sep 2023 14:48:07 +0100 Subject: [PATCH] Revert --- python/tests/test_imputation.py | 50 ++------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/python/tests/test_imputation.py b/python/tests/test_imputation.py index 7a56c171d4..d6fe804688 100644 --- a/python/tests/test_imputation.py +++ b/python/tests/test_imputation.py @@ -492,9 +492,9 @@ def test_compare_imputed_alleles(input_ref, input_query, expected): "input_ref,input_query,expected", [ (toy_ref_0, toy_query_0, toy_query_0_beagle_allele_probs), - (toy_ref_1, toy_query_1, toy_query_1_beagle_allele_probs), - (toy_ref_2, toy_query_2, toy_query_2_beagle_allele_probs), - (toy_ref_3, toy_query_3, toy_query_3_beagle_allele_probs), + # (toy_ref_1, toy_query_1, toy_query_1_beagle_allele_probs), + # (toy_ref_2, toy_query_2, toy_query_2_beagle_allele_probs), + # (toy_ref_3, toy_query_3, toy_query_3_beagle_allele_probs), # (toy_ref_4, toy_query_4, toy_query_4_beagle_allele_probs), # (toy_ref_5, toy_query_5, toy_query_5_beagle_allele_probs), # (toy_ref_6, toy_query_6, toy_query_6_beagle_allele_probs), @@ -513,50 +513,6 @@ def test_compare_allele_probabilities(input_ref, input_query, expected): assert np.allclose(allele_probs.T, expected[i], atol=1e-04) -@pytest.mark.parametrize( - "input_ref,input_query", - [ - (toy_ref_0, toy_query_0), - ], -) -def test_beagle_numba(input_ref, input_query): - pos = (np.arange(9) + 1) * 1e4 - num_query_haps = input_query.shape[0] - for i in np.arange(num_query_haps): - imputed_alleles, allele_probs = tests.beagle.run_beagle( - input_ref, input_query[i], pos, miscall_rate=0.0001, ne=10.0 - ) - imputed_alleles_numba, allele_probs_numba = tests.beagle_numba.run_beagle( - input_ref, input_query[i], pos, miscall_rate=0.0001, ne=10.0 - ) - assert np.array_equal(imputed_alleles, imputed_alleles_numba) - assert np.allclose(allele_probs, allele_probs_numba) - - -@pytest.mark.parametrize( - "input_ref,input_query", - [ - (toy_ref_0, toy_query_0), - ], -) -def test_tsimpute(input_ref, input_query): - pos = (np.arange(9) + 1) * 1e4 - num_query_haps = input_query.shape[0] - for i in np.arange(num_query_haps): - imputed_alleles, allele_probs = tests.beagle.run_beagle( - input_ref, input_query[i], pos, miscall_rate=0.0001, ne=10.0 - ) - # Note that parametrization of BEAGLE and tsinfer - mu = tests.beagle_numba.get_mismatch_prob(pos, miscall_rate=1e-8) - rho = tests.beagle_numba.get_switch_prob(pos, input_ref.shape[0], ne=10_000.0) - rho /= 1e5 - imputed_alleles_ts, allele_probs_ts = tests.beagle_numba.run_tsimpute( - input_ref, input_query[i], pos, mu, rho - ) - assert np.array_equal(imputed_alleles, imputed_alleles_ts) - assert np.allclose(allele_probs, allele_probs_ts) - - # Below is toy data set case 7 in tree sequence format. toy_ts_nodes_text = """\ id is_sample time population individual metadata