popsim-consortium / stdpopsim

A library of standard population genetic models
GNU General Public License v3.0
126 stars 87 forks source link

Allow more flexible sampling (e.g., from past times) #320

Open jeromekelleher opened 4 years ago

jeromekelleher commented 4 years ago

We're using sampling_time=None currently to denote populations that are never sampled from. In reality we should be able to sample from any population, it's mainly just a case of what time thoses samples should be at. This gets complicated though, since someone may want to sample at multiple times from the same population. Then, we can just use the standard msprime API for creating samples.

So, perhaps the current approach is a good compromise, covering the majority of cases people will want?

ndukler commented 4 years ago

I agree. We can even put together a tutorial on how to customize sampling.

jeromekelleher commented 3 years ago

@grahamgower, this has come up as the main sticking point in #764. Is there a good reason for never allowing samples from a population, or is it just because we don't have the right times?

grahamgower commented 3 years ago

I think we should be able to sample from any population at any time over it's period of existence. But there's a problem if we change to this now, because we already have a notion of populations that can't be sampled. The real kicker is that this has implications for the number and order of CLI parameters used for sampling.

jeromekelleher commented 3 years ago

OK, thanks. I guess we'll need to think about the models in question so that we can be sure of keeping compatibility with the CLI.