Skip to content

Commit

Permalink
Change class names
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Apr 20, 2024
1 parent d4140cb commit e59bee7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/lsbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""


Expand Down
4 changes: 2 additions & 2 deletions tests/test_API.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_API_multiallelic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions tests/test_non_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e59bee7

Please sign in to comment.