Closed petrelharp closed 7 years ago
Hmm. At first I thought it was obvious, you need to remove pop = simu.population(0)
? https://github.com/ashander/ftprime/blob/master/tests/test_ftprime_with_simuPOP.py#L52
But then there is still a ValueError
. Weird. Not creating a simulator from that pop solves this. See the top 3 commits on explore/simu-vs-pop-errors
A hint from the help of Simulator
suggests the underlying reason is that pop data is not deep copied by default when you create a simulator from a pop
Create a simulator with rep (default to 1) replicates of populations pops, which is a list of populations although a single population object is also acceptable. Contents of passed populations are by default moved to the simulator to avoid duplication of potentially large population objects, leaving empty populations behind. This behavior can be changed by setting stealPops to False, in which case populations are copied to the simulator.
Sure enough if we don't stealPops
then it also works 4bafa22a8c648916338969e714284f4419bc5406
great. thanks for working that out.
Why is this? If we change the
simu.evolve( )
call intest_ftprime_with_simuPOP.py
topop.evolve( )
-- which should be functionally the same, as the simuPOP documentation says that evolvling a population just evolves a single replicate in a simulator -- it throws a keyError.