Skip to content

Commit

Permalink
Raise exception if infinite_sites is called during a simulation.
Browse files Browse the repository at this point in the history
Closes #769
  • Loading branch information
molpopgen committed Oct 15, 2021
1 parent 95a3601 commit ee3d402
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fwdpy11/src/ts/infinite_sites.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ init_infinite_sites(py::module& m)
"infinite_sites",
[](const fwdpy11::GSLrng_t& rng, fwdpy11::Population& pop,
const double mu) -> unsigned {
if (pop.is_simulating)
{
throw std::runtime_error(
"infinite_sites cannot be called during a simulation");
}
if (mu <= 0.0)
{
return 0u;
Expand Down

0 comments on commit ee3d402

Please sign in to comment.