-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tables.tree_sequence() does not check if nodes from an individual are contiguous #750
Comments
I vaguely remember deciding that we should enforce this, and the only individual-producing code I can think of - which is SLiM - will ensure this. So, that seems good. And, I still think it's a good idea. It could cause someone's script that makes up individuals produce a bad tree sequence, so this should definately be added to the CHANGELOG under "possibly breaking changes". And, btw, this requirement means that adding individuals to - say - an msprime simulation could require re-ordering the nodes, so it's a good thing we have |
p.s. I can't think of anywhere this would currently lead to bugs, so that's good anyhow. |
This does seem like a bug if we're not enforcing the property and we're using it internally. I'm not sure that we are though, it seems like a pretty big oversight if we forgot to test it. |
I'll have a look through the code - we don't use node.individual in very many places, so it won't be too bad to check. |
Nope - we really don't seem to be relying on this property anywhere in the C code. The code that finds which nodes go to which individual ( |
So should I delete the comment in the docs then? |
Yes please - we've clearly gone to the trouble of implementing and testing this without assuming adjacency, and the docs must have been forgotten about. |
In the docs it says "For simplicity and algorithmic efficiency, all nodes referring to the same (non-null) individual must be contiguous.". But this isn't checked when converting tables to a tree sequence (see below). I assume this could lead to bugs.
The text was updated successfully, but these errors were encountered: