Skip to content

Add omit_missing to Tree.nodes()? #442

@hyanwong

Description

@hyanwong

At the moment, the Tree.nodes() method lists all the nodes in a tree, even if the node is isolated (i.e. has missing data). It would be useful for me to somehow iterate through the nodes without counting the missing ones. A parameter to the Tree.nodes() iterator would work, or perhaps an easy way to check if a node is isolated? The only way I can think to do this now is to check Tree.num_children(node) == 0 and Tree.parent(node) == tskit.NULL - is that right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions