Skip to content

Commit

Permalink
Squash unintended recombination rate test warnings (#1630)
Browse files Browse the repository at this point in the history
* Squash unintended rec rate test warnings
  • Loading branch information
gregorgorjanc authored Dec 24, 2024
1 parent 1e3eb64 commit 451b94e
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,18 @@ def test_debug_runs(self):

@pytest.mark.filterwarnings("ignore:.*Zigzag_1S14.*:UserWarning")
def test_simulation_runs(self):
# With a recombination_map of None, we simulate a coalescent without
# recombination in msprime, with mutation rate equal to rate from model.
# For the purposes of testing the model, here we use the
# model's mutation and recombination rate if it has them;
# otherwise, we use zero recombination and the species
# mutation rate.
if self.model.recombination_rate is None:
recombination_rate = 0
else:
recombination_rate = self.model.recombination_rate
contig = stdpopsim.Contig.basic_contig(
length=100, mutation_rate=self.model.mutation_rate
length=100,
mutation_rate=self.model.mutation_rate,
recombination_rate=recombination_rate,
)
# Generate vector with 2 samples for each pop with sampling enabled
samples = {}
Expand Down

0 comments on commit 451b94e

Please sign in to comment.