From e59bee7c4e541a965edefbf47d124d78fab66df3 Mon Sep 17 00:00:00 2001 From: szhan Date: Sat, 20 Apr 2024 14:36:33 +0100 Subject: [PATCH] Change class names --- tests/lsbase.py | 2 +- tests/test_API.py | 4 ++-- tests/test_API_multiallelic.py | 2 +- tests/test_non_tree.py | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/lsbase.py b/tests/lsbase.py index 8afaea3..0922f81 100644 --- a/tests/lsbase.py +++ b/tests/lsbase.py @@ -296,7 +296,7 @@ def get_larger(self, num_samples, seq_length, mean_r, mean_mu, seed=42): return ts -class FBAlgorithmBase(LSBase): +class ForwardBackwardAlgorithmBase(LSBase): """Base for testing forwards-backwards algorithms.""" diff --git a/tests/test_API.py b/tests/test_API.py index 0e50fe2..fbc6f93 100644 --- a/tests/test_API.py +++ b/tests/test_API.py @@ -6,7 +6,7 @@ import lshmm.vit_haploid as vh -class TestForwardBackwardHaploid(lsbase.FBAlgorithmBase): +class TestForwardBackwardHaploid(lsbase.ForwardBackwardAlgorithmBase): def verify(self, ts): for n, m, H_vs, s, e_vs, r, mu in self.get_examples_pars_haploid(ts): F_vs, c_vs, ll_vs = fbh.forwards_ls_hap(n, m, H_vs, s, e_vs, r) @@ -41,7 +41,7 @@ def test_simple_n16(self): self.verify(ts) -class TestForwardBackwardDiploid(lsbase.FBAlgorithmBase): +class TestForwardBackwardDiploid(lsbase.ForwardBackwardAlgorithmBase): def verify(self, ts): for n, m, G_vs, s, e_vs, r, mu in self.get_examples_pars_diploid(ts): F_vs, c_vs, ll_vs = fbd.forward_ls_dip_loop( diff --git a/tests/test_API_multiallelic.py b/tests/test_API_multiallelic.py index 5b42497..5a3abfa 100644 --- a/tests/test_API_multiallelic.py +++ b/tests/test_API_multiallelic.py @@ -4,7 +4,7 @@ import lshmm.vit_haploid as vh -class TestMethodsHaploid(lsbase.FBAlgorithmBase): +class TestForwardBackwardHaploid(lsbase.ForwardBackwardAlgorithmBase): def verify(self, ts): for n, m, H_vs, s, e_vs, r, mu in self.get_examples_pars_haploid(ts): F_vs, c_vs, ll_vs = fbh.forwards_ls_hap(n, m, H_vs, s, e_vs, r) diff --git a/tests/test_non_tree.py b/tests/test_non_tree.py index 7637c33..fa4c975 100644 --- a/tests/test_non_tree.py +++ b/tests/test_non_tree.py @@ -8,11 +8,12 @@ import lshmm.vit_haploid as vh -class TestNonTreeForwardBackwardHaploid(lsbase.FBAlgorithmBase): +class TestNonTreeForwardBackwardHaploid(lsbase.ForwardBackwardAlgorithmBase): def verify(self, n, m, H_vs, s, e_vs, r): F_vs, c_vs, ll_vs = fbh.forwards_ls_hap(n, m, H_vs, s, e_vs, r, norm=False) B_vs = fbh.backwards_ls_hap(n, m, H_vs, s, e_vs, c_vs, r) self.assertAllClose(np.log10(np.sum(F_vs * B_vs, 1)), ll_vs * np.ones(m)) + F_tmp, c_tmp, ll_tmp = fbh.forwards_ls_hap(n, m, H_vs, s, e_vs, r, norm=True) B_tmp = fbh.backwards_ls_hap(n, m, H_vs, s, e_vs, c_tmp, r) self.assertAllClose(ll_vs, ll_tmp) @@ -65,7 +66,7 @@ def test_larger(self): self.verify(n, m, H_vs, s, e_vs, r) -class TestNonTreeForwardBackwardDiploid(lsbase.FBAlgorithmBase): +class TestNonTreeForwardBackwardDiploid(lsbase.ForwardBackwardAlgorithmBase): def verify(self, n, m, G_vs, s, e_vs, r): F_vs, c_vs, ll_vs = fbd.forwards_ls_dip(n, m, G_vs, s, e_vs, r, norm=True) B_vs = fbd.backwards_ls_dip(n, m, G_vs, s, e_vs, c_vs, r)