Skip to content

Test various functions with "empty" trees / tree sequences #943

@hyanwong

Description

@hyanwong

Functions like Tree.draw_text() and TreeSequence.draw_text() fail at the moment with ValueError: negative dimensions are not allowed if there are no edges, e.g.

tskit.TableCollection(1).tree_sequence().first().draw_text()

And there's no trivial way to create empty trees/tree sequences: you have to go via a TableCollection as in the example above. This makes me think that we haven't been testing many of our functions against these instances. It might be useful to feed such empty instances into all the functions / methods that deal with Trees or TreeSequences. I wonder if this can be done automatically somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Infrastructure and toolsDevelopment infrastructure and toolsPython APIIssue is about the Python APIfutureIssues that are closed as they are not planned in the medium-term, but which are still desirable.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions