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

Modify ladderize method to avoid recursion depth error #716

Closed harryrichman closed 8 months ago

harryrichman commented 8 months ago

The modified version of the ladderize method uses memoization rather than pure recursion. This avoids a RecursionError being thrown when called on a large tree.

Closes #715

jordibc commented 8 months ago

Merged and tweaked. Thanks @harryrichman

All the new development is going into ete4 and we are actually not developing ete3 anymore. In any case, since after your PR we had an improvement for ladderize() in ete4, we have also exceptionally backported it. Thanks again!