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
test for time with keep_roots #823
Conversation
8ce1334
to
a9d314a
Compare
c/tskit/tables.c
Outdated
@@ -6458,7 +6458,7 @@ simplifier_insert_input_roots(simplifier_t *self) | |||
if (ret != 0) { | |||
goto out; | |||
} | |||
simplifier_map_mutations(self, input_id, x->left, x->right, x->node); | |||
simplifier_map_mutations(self, input_id, x->left, x->right, output_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double Doh!
I guess this slipped through the cracks because assigning a mutation to the root node instead of the node-above-the-root doesn't change anything except for the genotype of the node-above-the-root-node.I only saw it because mutation.time caused it to throw an error! |
Codecov Report
@@ Coverage Diff @@
## master #823 +/- ##
=======================================
Coverage 93.57% 93.57%
=======================================
Files 24 24
Lines 19545 19545
Branches 789 789
=======================================
Hits 18290 18290
Misses 1223 1223
Partials 32 32
Continue to review full report at Codecov.
|
Dammit! Great catch, thanks @petrelharp. Looks like we need to get a bugfix release out for this. Can you add your example above in as an explicit standalone test? I think it's good to keep simple tests around that show these bugs, just in case we ever regress. |
I've fixed up the python version of simplify to agree, and added tests for above-the-root mutations here (and, elsewhere, since I've added them to tsutil.insert_branch_mutations, miraculously not breaking anything!). So... maybe this is ready to go? If others and/or CI don't spot anything? |
Well, I was going to, but instead I modified this test to do pretty much exactly that. I think it's a simple and stand-along enough test? |
Gah, as noted elsewhere my pre-commit is broken... |
Sure, sounds good. The tests are pretty strong now you've added mutations over the root to the insert mutations method. |
Ready to go, if you could squash, please |
Added to 0.99.6 which is shaping up to be a bugfix release. |
7de0ddc
to
6778639
Compare
Squashed; should be ready. |
Thanks for cleaning up my mess @petrelharp! We'll get this bundled into a C release in the next few days so you can pull it into SLiM. |
There appears to be a bug related to mutation times and
simplify(keep_input_roots=True)
. This PR modifies a test so that it triggers the problem: simplify changes the node the mutation is on, if that node is retained as an input root. Here's a simple example:The
node
should be1
afterwards, not0
, and doingt.tree_sequence()
throwsI'll see if I can track this down now...