(self, cloning=False)
Creates a *cache* on the tree, this method must be called
      every time you change the shape of the tree. It updates the
      internal nodes list and the internal nodes properties such as
      depth and height.
Creates a *cache* on the tree, this method must be called
      every time you change the shape of the tree. It updates the
      internal nodes list and the internal nodes properties such as
      depth and height.
Creates a * cache * on the tree this method must be called every time you change the shape of the tree . It updates the internal nodes list and the internal nodes properties such as depth and height .
def processNodes(self, cloning=False):
      """ Creates a *cache* on the tree, this method must be called
      every time you change the shape of the tree. It updates the
      internal nodes list and the internal nodes properties such as
      depth and height.
      """
      if self.root_node is None:
         return
      self.nodes_list = self.getAllNodes()
      self.nodes_leaf = filter(lambda n: n.isLeaf(), self.nodes_list)
      self.nodes_branch = filter(lambda n: n.isLeaf() is False, self.nodes_list)

      if not cloning:
         self.tree_height = self.getNodeHeight(self.getRoot())
def processNodes ( self , cloning = False ) : if self . root_node is None : return self . nodes_list = self . getAllNodes ( ) self . nodes_leaf = filter ( lambda n : n . isLeaf ( ) , self . nodes_list ) self . nodes_branch = filter ( lambda n : n . isLeaf ( ) is False , self . nodes_list ) if not cloning : self . tree_height = self . getNodeHeight ( self . getRoot ( ) )