From bb5803b18b6b182102d9e916bb9442addb017fab Mon Sep 17 00:00:00 2001 From: szhan Date: Wed, 19 Jun 2024 13:52:04 +0100 Subject: [PATCH] Fix bug when adding extreme recombination probabilities --- tests/lsbase.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/lsbase.py b/tests/lsbase.py index d13c0b0..bc6e176 100644 --- a/tests/lsbase.py +++ b/tests/lsbase.py @@ -150,12 +150,10 @@ def get_examples_pars( ), "Reference haplotypes have unexpected number of copiable entries." r_s = [ - np.zeros(m) + 0.01, # Equal recombination and mutation - np.random.rand(m), # Random - 1e-5 * (np.random.rand(m) + 0.5) / 2, + np.append([0], np.zeros(m - 1) + 0.01), + np.append([0], np.random.rand(m - 1)), + np.append([0], 1e-5 * (np.random.rand(m - 1) + 0.5) / 2), ] - for i in range(len(r_s)): - r_s[i][0] = 0 mu_s = [ np.zeros(m) + 0.01, # Equal recombination and mutation @@ -165,8 +163,8 @@ def get_examples_pars( ] if include_extreme_rates: - r_s.append(np.zeros(m) + 0.2) - r_s.append(np.zeros(m) + 1e-6) + r_s.append(np.append([0], np.zeros(m - 1) + 0.2)) + r_s.append(np.append([0], np.zeros(m - 1) + 1e-6)) mu_s.append(np.zeros(m) + 0.2) mu_s.append(np.zeros(m) + 1e-6)