etetoolkit / ete

Python package for building, comparing, annotating, manipulating and visualising trees. It provides a comprehensive API and a collection of command line tools, including utilities to work with the NCBI taxonomy tree.
http://etetoolkit.org
GNU General Public License v3.0
768 stars 216 forks source link

Fix broken str.join() in ncbiquery.generate_table() #712

Closed dorbarker closed 9 months ago

dorbarker commented 9 months ago

A recent commit (7024539) introduced a bug which broke the ability to load the NCBI taxonomy by running ete4.NCBITaxa(). This PR fixes that bug by making sure that str.join gets a list as its single parameter. I also refactored the function slightly while I was at it to use the more pythonic context manager rather than manually opening and closing the file handle and to reduce code duplication.

All 5 tests pass after running python -m unittest tests.test_ncbiquery