Get all leaf nodes from the tree of which this is the head.
This returns a generator of all leaf nodes belonging to this tree. A leaf node is a node that has no ancestors.
Parameters: selector (optional, str ("forest", "tree", or "prog")) – The tree selector from which leaf nodes will be found. If none given, this will be set to “forest” if the calling node is a root node and “tree” otherwise. Returns: leaf_nodes –
Return type: a generator of
>>> import ytree >>> a = ytree.load("tiny_ctrees/locations.dat") >>> my_tree = a >>> for leaf in my_tree.get_leaf_nodes(): ... print (leaf["mass"])