def get_depth(tree, name):
    """
    Simple utility method that iterates through components in a PlanetaryTree.
    It determines the minimum distance from root to named node.
    """
    for node in tree:
        if node[0].name == name:
            return node[1]  # "depth" it was found at

    # Element not found
    raise ValueError