File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
source-code/testing/Unittest/Newick Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22'''module containing various functions for working with trees and nodes'''
33
4- from node_parser import NodeParser
54import unittest
5+ from node_parser import NodeParser
66
77
88def depth (node ):
99 '''compute the depth of the given tree'''
1010 if node is None :
1111 return 0
12- elif node .is_leaf ():
12+ if node .is_leaf ():
1313 return 1
14- else :
15- return 1 + max (list (map (depth , node .children ())))
14+ return 1 + max (list (map (depth , node .children ())))
1615
1716
1817def depth_first_iterator (node ):
@@ -131,5 +130,6 @@ def test_deep_tree(self):
131130 tree = parser .node ()
132131 self .assertEqual (nr_leaf_nodes (tree ), 1 )
133132
133+
134134if __name__ == '__main__' :
135135 unittest .main ()
You can’t perform that action at this time.
0 commit comments