Skip to content

Tree.root_threshold not working correctly on empty tree sequence #1706

Closed

Description

@jeromekelleher
tables = tskit.TableCollection(1)
for _ in range(10):
    tables.nodes.add_row(flags=tskit.NODE_IS_SAMPLE, time=0)
ts = tables.tree_sequence()
print(ts)

tree = tskit.Tree(ts)
tree.first()
print(tree.roots)
# Gives [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
tree = tskit.Tree(ts, root_threshold=2)
tree.first()
print(tree.roots)
# Gives [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

The list of roots should be empty in the second case.

Activity

  1. added
    bug
    on Sep 16, 2021
  2. added 2 commits that reference this issue on Oct 15, 2021
    a384c3e
    a882a5d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions