Skip to content

Commit

Permalink
test for time with keep_roots
Browse files Browse the repository at this point in the history
  • Loading branch information
petrelharp committed Sep 1, 2020
1 parent b50bed5 commit 8ce1334
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions python/tests/test_topology.py
Expand Up @@ -3228,19 +3228,22 @@ def test_map_mutations_with_and_without_roots(self):
id is_sample time
0 1 0
1 0 1
2 0 2
"""
edges_before = """\
left right parent child
0 2 1 0
0 2 2 1
"""
sites = """\
id position ancestral_state
0 1.0 0
"""
mutations_before = """\
site node derived_state
0 0 2
0 1 1
site node derived_state time
0 0 2 0
0 1 1 1
0 2 3 2
"""
# expected result without keep_input_roots
nodes_after = """\
Expand All @@ -3251,20 +3254,26 @@ def test_map_mutations_with_and_without_roots(self):
left right parent child
"""
mutations_after = """\
site node derived_state
0 0 2
0 0 1
site node derived_state time
0 0 2 0
0 0 1 1
0 0 3 2
"""
# expected result with keep_input_roots
nodes_after_keep = nodes_before
nodes_after_keep = """\
id is_sample time
0 1 0
1 0 2
"""
edges_after_keep = """\
left right parent child
0 2 1 0
"""
mutations_after_keep = """\
site node derived_state
0 0 2
0 0 1
site node derived_state time
0 0 2 0
0 0 1 1
0 1 3 2
"""
self.verify_simplify(
samples=[0],
Expand Down

0 comments on commit 8ce1334

Please sign in to comment.