You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test various functions with "empty" trees / tree sequences #943
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.
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.
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?
A lot of the methods are being tested on an empty/null tree sequence, but it's not systematic. I guess we should add this to the list of example topologies when we're making the set of standard fixtures for pytest.
I think we should test drawing functions in a separate PR (the pattern there is clear - add a test for this case).
Yep - I just noticed that there was an empty TS in test_highlevel.py::get_example_tree_sequences which I moved to tsutil.py in #931 . So perhaps it's just the drawing code. Having a standard set of examples would be useful, which is why I moved the functions in that PR, but we probably need something more systematic, as you say.
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.
Activity
jeromekelleher commentedon Oct 28, 2020
A lot of the methods are being tested on an empty/null tree sequence, but it's not systematic. I guess we should add this to the list of example topologies when we're making the set of standard fixtures for pytest.
I think we should test drawing functions in a separate PR (the pattern there is clear - add a test for this case).
hyanwong commentedon Oct 28, 2020
Yep - I just noticed that there was an empty TS in
test_highlevel.py::get_example_tree_sequenceswhich I moved totsutil.pyin #931 . So perhaps it's just the drawing code. Having a standard set of examples would be useful, which is why I moved the functions in that PR, but we probably need something more systematic, as you say.benjeffery commentedon Jun 12, 2025
Closing for inactivity and labelling "future", please re-open if you plan to work on this.