Skip to content

Commit

Permalink
Add test that requires fixations to be removed after
Browse files Browse the repository at this point in the history
final simplification post-simulation. See 06a8a41.
  • Loading branch information
molpopgen committed Feb 3, 2021
1 parent 06a8a41 commit 0da3214
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/test_ancient_samples_with_neutral_mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,33 @@ def test_ancient_samples_and_neutral_mutations(
assert len(s) == mslike_pop.mcounts[m.key]
if prune_selected is True and len(s) == 2 * mslike_pop.N:
assert mslike_pop.mcounts_ancient_samples[m.key] > 0


def test_trigger_final_simplification_with_fixations_to_remove():
"""
MRE that triggers an exception that would hit after many of the
changes in PR647 were in place. Commit 06a8a41 avoids the exception.
"""
burnin = 10
N = 133
pdict = {
# Add a region for neutral mutations:
"nregions": [fwdpy11.Region(0, 1, 1)],
"sregions": [fwdpy11.ExpS(beg=0, end=1, weight=1, mean=0.2)],
"recregions": [fwdpy11.PoissonInterval(0, 1, 1e-2)],
"gvalue": [fwdpy11.Multiplicative(2.0)],
"rates": (1e-3, 1e-3, None),
"simlen": burnin * N,
"prune_selected": True,
}
params = fwdpy11.ModelParams(**pdict)
pop = fwdpy11.DiploidPopulation(N, 1.0)
rng = fwdpy11.GSLrng(54321)

fwdpy11.evolvets(
rng,
pop,
params,
37,
suppress_table_indexing=False,
)

0 comments on commit 0da3214

Please sign in to comment.