Closed IsabelMarleen closed 1 year ago
Thanks for the report.
Hmm, I am sort of aware of this issue. I have poked around this a bit and discovered some weird edge cases in which the gene_flow()
function does not have a complete information about the intended flow of time... which doesn't appear to be the case here in your minimal example (thanks for providing this, this is really great).
I think it had something to do with one population existing within the gene-flow time window, but the other existing outside (either before it or after it)? I'll have to check my notes.
The easiest thing we could do for now is simply write a generic error about a gene flow being somehow broken. Less satisfying and less informative, but at least not misleading.
Fun fact: I just removed some code and gene_flow()
behaves like you (correctly) identified @IsabelMarleen.
... too good to be true on Friday afternoon.
Fun fact: I just removed some code and gene_flow() behaves like you (correctly) identified @IsabelMarleen […] ... too good to be true on Friday afternoon.
Huh, it seems it was that after all. An old time consistency check which originated when slendr could only do spatial SLiM models was triggered in situations were another error message was more appropriate.
All tests pass as they should, so fingers crossed.
There is an issue with the error messages in the gene_flow() function for time inconsistencies. I found a minimal example where an error caused by an inconsistency with the assumed direction of time causes an error about the populations not being present in the time window and a second scenario where the opposite happens. This seems like an issue that could be caused by a condition being the wrong way around.
gf <- gene_flow(from = popA, to = popB, start = 4e6, end = (4e6+5), rate = 0.3)
This throws the error:but it should complain that the end time is before the start time.
gf <- gene_flow(from = popA, to = popB, start = 8e6, end = (8e6-5), rate = 0.3)
This throws the error:but it should complain that population B does not exist yet in this time window.