Skip to content

Commit

Permalink
get_midpoint function does not return None when tree already rooted a…
Browse files Browse the repository at this point in the history
…t midpoint. Returns first child instead
  • Loading branch information
jhcepas committed Aug 29, 2020
1 parent 6cad2f7 commit 7914155
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ete3/coretype/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,11 @@ def get_midpoint_outgroup(self):
break
else:
current = current.up

# if we reached the root, the tree is already at midpoint. Return any child as valid outgroup
if current is None:
current = self.children[0]

return current

def populate(self, size, names_library=None, reuse_names=False,
Expand Down

0 comments on commit 7914155

Please sign in to comment.