Skip to content

Convert nexus tests to use dendropy #1836

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

jeromekelleher
Copy link
Member

Closes #1785

Add dendropy to various requirements lists and refactor the tests to use pytest a little better

Hopefully this sets the foundation for following up with label changes etc.

@jeetsukumaran would you mind taking a quick look and seeing if the dendropy usage looks OK to you please?

@codecov
Copy link

codecov bot commented Oct 22, 2021

Codecov Report

Merging #1836 (b3ff095) into main (d7514b8) will decrease coverage by 0.00%.
The diff coverage is n/a.

❗ Current head b3ff095 differs from pull request most recent head 00967cb. Consider uploading reports for the commit 00967cb to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1836      +/-   ##
==========================================
- Coverage   93.43%   93.43%   -0.01%     
==========================================
  Files          27       27              
  Lines       24808    24804       -4     
  Branches     1094     1094              
==========================================
- Hits        23179    23175       -4     
  Misses       1594     1594              
  Partials       35       35              
Flag Coverage Δ
c-tests 92.20% <ø> (+<0.01%) ⬆️
lwt-tests 89.14% <ø> (ø)
python-c-tests 94.53% <ø> (-0.01%) ⬇️
python-tests 98.75% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/_tskitmodule.c 91.68% <0.00%> (-0.01%) ⬇️
python/tskit/trees.py 97.84% <0.00%> (-0.01%) ⬇️
python/tskit/drawing.py 99.42% <0.00%> (-0.01%) ⬇️
python/tskit/tables.py 98.79% <0.00%> (ø)
python/tskit/__init__.py 100.00% <0.00%> (ø)
c/tskit/tables.c 90.30% <0.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d7514b8...00967cb. Read the comment docs.

Closes tskit-dev#1785

Add dendropy to various requirements lists
Also refactor the tests to use pytest a little better
@jeetsukumaran
Copy link
Contributor

jeetsukumaran commented Oct 22, 2021

At first glance, this works fine. One caution is the expectation that every node (including internal nodes) on the dendropy tree have a non-None taxon attribute. This assumes that: (a) tskit emits internal node labels, and (b) dendropy parses these internal node labels as Taxon objects and assigns them to the taxon attribute of the corresponding node. The latter is not default behavior with dendropy (it parses them as labels), but, as you have done in the tests, setting suppress_internal_node_taxa=False gets it there. Just a note to keep in mind with test setup/administration.

@jeromekelleher
Copy link
Member Author

OK great, thanks @jeetsukumaran. I'll merge this and push a batch up updates to improve the nexus handling then.

@jeromekelleher jeromekelleher merged commit 804aabb into tskit-dev:main Oct 22, 2021
@jeromekelleher jeromekelleher deleted the test-nexus-dendropy branch October 22, 2021 18:18
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

to_nexus() does not emit compliant Nexus
2 participants