API Reference
This reference is automatically generated from the source code
and docstrings using mkdockstrings. This page will always
be up to date to the latest git commit, but you may prefer documentation written by an actual
human to be somewhat more palatable.
Because SuchTree and SuchLinkedTrees are written in Cython and compiled into a shared library,
the mkdocstrings is not (yet) able to extract the function implementations for documentation purposes.
Sorry about that. You can always look in the source code.
SuchTree.SuchTree
SuchTree extention type. The constructor accepts a filesystem path or URL to a file that describes the tree in NEWICK format. For now, SuchTree uses dendropy to parse the NEWICK file.
An array of type Node is allocated, and freed when SuchTree.dealloc is invoked.
Node.parent, Node.left_child and Node.right_child are integer offsets within this array, describing the tree structure. Nodes where left_child and right_child are -1 are leaf nodes, Nodes where the parent attribute is -1 are the root nodes (there should be only one of these in any given tree).
SuchTree expects trees to be strictly bifrucating. There should not be any nodes that have only one child.
SuchTrees are immutable; they cannot be modified once initialized. If you need to manipulate your tree before performing computations, you will need to use a different tool to perform those manipulations first.
SuchTree constructor.
Attributes
all_nodes
property
Array of all node IDs in the tree.
depth
property
The maximum depth of the tree.
internal_nodes
property
Array of internal node IDs.
leaf_names
property
List of all leaf names.
leaf_node_ids
property
Array of leaf node IDs.
leaf_nodes
property
Dictionary mapping leaf node IDs to names.
leafnodes
property
Deprecated : Use leaf_nodes instead.
leafs
property
Deprecated : Use leaves instead.
leaves
property
Dictionary mapping leaf names to node IDs.
length
property
Deprecated : Use size instead.
n_leafs
property
Deprecated : Use num_leaves instead.
num_leaves
property
The number of leaf nodes in the tree.
polytomy_distance
property
Deprecated : Use polytomy_epsilon instead.
polytomy_epsilon
property
Tiny, arbitrary, nonzero distance for polytomies.
relative_evolutionary_divergence
property
The relative evolutionary divergence (RED) of the nodes in the tree. The RED of a node is the relative placement between the root and its descending tips (Parks et al. 2018). RED is defined to range from 0 at the root node to 1 at each leaf. Traversing the tree in pre-order, RED is P+(a/(a+b))*(1-P), where P is the RED of the node's parent, a is the distance to its parent, and b is the average distance from the node to its leaf descendants.
RED is calculated for every node in the tree and returned as a dictionary. Once computed, the RED dictionary will be cached and made available as the SuchTree.RED attribute.
root
property
Deprecated : Use root_node instead.
root_node
property
The ID of the root node.
size
property
The number of nodes in the tree.
Functions
adjacency(node: int = -1)
method descriptor
Deprecated : Use adjacency_matrix instead.
adjacency_matrix(from_node: Union[int, str] = None) -> Dict[str, Any]
method descriptor
Build the graph adjacency matrix of the tree or subtree.
Renamed from adjacency().
Args from_node : Root node for subtree (default: tree root)
Returns Dict[ str, Any ] : Dictionary with keys: - 'adjacency_matrix' : np.ndarray of edge weights - 'node_ids' : np.ndarray of corresponding node IDs
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
bipartition(node: Union[int, str], by_id: bool = False) -> frozenset
method descriptor
Get the bipartition created by an internal node.
Renamed from get_bipartition() for consistency.
Args node : Internal node (ID or name) by_id : If True, return node IDs; if False, return leaf names
Returns frozenset : Frozenset of two frozensets representing the bipartition
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds or is a leaf node
bipartitions(by_id: bool = False) -> Generator[frozenset, None, None]
method descriptor
Generate all bipartitions in the tree. Each bipartition is the pair of sets of leaf nodes partitioned by an internal node in the tree.
Args by_id : If True, yield node IDs; if False, yield leaf names
Yields frozenset : Bipartition as frozenset of two frozensets
common_ancestor(a: Union[int, str], b: Union[int, str]) -> int
method descriptor
Find the most recent common ancestor of two nodes.
Renamed from mrca().
Args a : First node (ID or name) b : Second node (ID or name)
Returns int : Node ID of most recent common ancestor
Raises NodeNotFoundError : If any leaf name is not found InvalidNodeError : If any node ID is out of bounds
degree_sequence(from_node: Union[int, str] = None) -> Dict[str, Any]
method descriptor
Compute the degree sequence of the tree.
Args from_node : Root node for subtree (default: tree root)
Returns Dict[ str, Any ] : Dictionary with keys : - 'degrees' : np.ndarray of node degrees - 'node_ids' : np.ndarray of corresponding node IDs - 'max_degree' : Maximum degree - 'min_degree' : Minimum degree
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
distance(a: Union[int, str], b: Union[int, str]) -> float
method descriptor
Calculate patristic distance between two nodes.
Args a : First node (ID or name) b : Second node (ID or name)
Returns float : Patristic distance between the nodes
Raises NodeNotFoundError : If any leaf name is not found InvalidNodeError : If any node ID is out of bounds
distance_matrix(nodes: list = None) -> Dict[str, Any]
method descriptor
Build a distance matrix for specified nodes. Wraps pairwise_distances.
Args nodes : List of nodes (IDs or names). If None, uses all leaves.
Returns Dict[ str, Any ] : Dictionary with keys : - 'distance_matrix' : np.ndarray of pairwise distances - 'node_ids' : np.ndarray of corresponding node IDs - 'node_names' : List of node names (if applicable)
Raises NodeNotFoundError : If any leaf name is not found InvalidNodeError : If any node ID is out of bounds
distance_to_root(node: Union[int, str]) -> float
method descriptor
Return distance from a node to the root.
Renamed from get_distance_to_root() for consistency.
Args node : Node ID or leaf name
Returns float : Distance to root node
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
distances(pairs)
method descriptor
Deprecated : Use distances_bulk instead.
distances_bulk(pairs: ArrayLike) -> np.ndarray
method descriptor
Calculate distances for multiple node pairs efficiently.
Renamed from distances() for clarity about bulk operation.
Args pairs : (n, 2) array of node ID pairs
Returns np.ndarray : Array of n distances
Raises ValueError : If pairs array shape is incorrect InvalidNodeError : If any node ID is out of bounds
distances_by_name(pairs: List[Tuple[str, str]]) -> List[float]
method descriptor
Calculate distances for pairs of leaf names.
Args pairs : List of (leaf_name1, leaf_name2) tuples
Returns List[ float ] : List of patristic distances
Raises NodeNotFoundError : If any leaf name is not found TypeError : If pairs is not a list of tuples
dump_array()
method descriptor
Print the whole tree. (WARNING : may be huge and useless.)
edges_data()
method descriptor
Deprecated : Use to_networkx_edges instead.
get_ancestors(node: Union[int, str]) -> Generator[int, None, None]
method descriptor
Generator yielding ancestor node IDs from node to root.
Renamed from get_lineage() for clarity.
Args node : Node ID or leaf name
Yields int : Ancestor node IDs in order from parent to root
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
get_bipartition(node: Union[int, str], by_id: bool = False)
method descriptor
Deprecated : Use bipartition instead.
get_children(node: Union[int, str]) -> Tuple[int, int]
method descriptor
Return the child node IDs for a given node.
Args node : Node ID or leaf name
Returns Tuple[ int, int ] : Left and right child node IDs (child of leaf is -1)
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
get_descendant_nodes(node: Union[int, str])
method descriptor
Deprecated : Use get_descendants instead.
get_descendants(node_id: int) -> Generator[int, None, None]
method descriptor
Generator yielding all descendant node IDs from a given node.
Renamed from get_descendant_nodes() for consistency.
Args node_id : Node ID
Yields int : Descendant node IDs including the starting node
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
get_distance_to_root(node: Union[int, str]) -> float
method descriptor
Deprecated : Use distance_to_root instead.
get_internal_nodes(from_node=-1)
method descriptor
Return an array of the ids of all internal nodes.
get_leafs(node: Union[int, str])
method descriptor
Deprecated : Use get_leaves instead.
get_leaves(node: Union[int, str]) -> np.ndarray
method descriptor
Return array of leaf node IDs descended from a given node.
Renamed from get_leafs() with corrected pluralization.
Args node : Node ID or leaf name
Returns np.ndarray : Array of leaf node IDs
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : I.f node ID is out of bounds
get_lineage(node: Union[int, str])
method descriptor
Deprecated : Use get_ancestors instead.
get_links(leaf_ids)
method descriptor
Returns an array of column ids for an array of leaf ids.
get_nodes(from_node=-1)
method descriptor
Return an array of the ids of all nodes.
get_parent(node: Union[int, str]) -> int
method descriptor
Return the parent node ID for a given node.
Args node : Node ID or leaf name
Returns int : Parent node ID (parent of root is -1)
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
get_quartet_topology(a, b, c, d)
method descriptor
Deprecated : Use quartet_topology instead.
get_support(node: Union[int, str]) -> float
method descriptor
Return the support value for a given node.
Args node : Node ID or leaf name
Returns float : Support value (-1 if no support available)
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
has_children(node: Union[int, str]) -> bool
method descriptor
Test if a node has children (i.e., is not a leaf).
Args node : Node ID or leaf name
Returns bool : True if node has children
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
has_parent(node: Union[int, str]) -> bool
method descriptor
Test if a node has a parent (i.e., is not the root).
Args node : Node ID or leaf name
Returns bool : True if node has a parent
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
in_order(distances: bool = True)
method descriptor
Deprecated : Use traverse_inorder instead.
incidence_matrix(from_node: Union[int, str] = None) -> Dict[str, Any]
method descriptor
Build the incidence matrix of the tree or subtree.
Args from_node : Root node for subtree (default: tree root)
Returns Dict[ str, Any ] : Dictionary with keys : - 'incidence_matrix' : np.ndarray where rows=nodes, cols=edges - 'node_ids' : np.ndarray of node IDs - 'edge_list' : List of (parent, child) tuples
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
is_ancestor(ancestor: Union[int, str], descendant: Union[int, str]) -> int
method descriptor
Test ancestral relationship between two nodes.
Args ancestor : Potential ancestor node (ID or name) descendant : Potential descendant node (ID or name)
Returns int : 1 if ancestor is ancestor of descendant, -1 if descendant is ancestor of ancestor, 0 if neither is ancestor of the other
Raises NodeNotFoundError : If any leaf name is not found InvalidNodeError : If any node ID is out of bounds
is_descendant(descendant: Union[int, str], ancestor: Union[int, str]) -> bool
method descriptor
Test if descendant is a descendant of ancestor.
New method for clarity - complements is_ancestor().
Args descendant : Potential descendant node (ID or name) ancestor : Potential ancestor node (ID or name)
Returns bool : True if descendant is a descendant of ancestor
Raises NodeNotFoundError : If any leaf name is not found InvalidNodeError : If any node ID is out of bounds
is_internal(node: Union[int, str]) -> bool
method descriptor
Test if a node is an internal node.
Renamed from is_internal_node() for consistency.
Args node : Node ID or leaf name
Returns bool : True if node is internal, False otherwise
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
is_internal_node(node: Union[int, str]) -> bool
method descriptor
Deprecated : Use is_internal instead.
is_leaf(node: Union[int, str]) -> bool
method descriptor
Test if a node is a leaf node.
Args node : Node ID or leaf name
Returns bool : True if node is a leaf, False otherwise
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
is_root(node: Union[int, str]) -> bool
method descriptor
Test if a node is the root node.
Args node : Node ID or leaf name
Returns bool : True if node is the root
Raises NodeNotFoundError : If leaf name is not found InvalidNodeError : If node ID is out of bounds
is_sibling(node1: Union[int, str], node2: Union[int, str]) -> bool
method descriptor
Test if two nodes are siblings (share the same parent).
Args node1 : First node (ID or name) node2 : Second node (ID or name)
Returns bool : True if nodes are siblings
Raises NodeNotFoundError : If any leaf name is not found InvalidNodeError : If any node ID is out of bounds
laplacian(node: int = -1)
method descriptor
Deprecated : Use laplacian_matrix instead.
laplacian_matrix(from_node: Union[int, str] = None) -> Dict[str, Any]
method descriptor
Build the graph Laplacian matrix of the tree or subtree.
Renamed from laplacian().
Args from_node : Root node for subtree (default: tree root)
Returns Dict[ str, Any ] : Dictionary with keys: - 'laplacian' : np.ndarray of Laplacian matrix - 'node_ids' : np.ndarray of corresponding node IDs
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
link_leaf(leaf_id, col_id)
method descriptor
Attaches a leaf node to SuchLinkedTrees link matrix column.
mrca(a: Union[int, str], b: Union[int, str]) -> int
method descriptor
Deprecated : Use common_ancestor instead.
nearest_neighbors(node: Union[int, str], k: int = 1, from_nodes: List[Union[int, str]] = None) -> List[Tuple[Union[int, str], float]]
method descriptor
Find the k nearest neighbors to a given node.
Args node : Query node (ID or name) k : Number of nearest neighbors to return from_nodes : Nodes to search among (default: all leaves except query)
Returns List[ Tuple[ Union[ int, str ], float ] ] : List of (node, distance) pairs
Raises NodeNotFoundError : If any leaf name is not found InvalidNodeError : If any node ID is out of bounds ValueError : If k is not positive
nodes_data()
method descriptor
Deprecated : Use to_networkx_nodes instead.
pairwise_distances(nodes: List[Union[int, str]] = None) -> np.ndarray
method descriptor
Calculate all pairwise distances between given nodes.
Args nodes : List of nodes (IDs or names). If None, uses all leaves.
Returns np.ndarray : Symmetric distance matrix
Raises NodeNotFoundError : If any leaf name is not found InvalidNodeError : If any node ID is out of bounds
path_between_nodes(a: Union[int, str], b: Union[int, str]) -> List[int]
method descriptor
Find the path between two nodes through their common ancestor.
New convenience method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a
|
Union[int, str]
|
First node (ID or name) |
required |
b
|
Union[int, str]
|
Second node (ID or name) |
required |
Returns:
| Type | Description |
|---|---|
List[int]
|
List[int]: List of node IDs forming the path from a to b |
Raises:
| Type | Description |
|---|---|
NodeNotFoundError
|
If any leaf name is not found |
InvalidNodeError
|
If any node ID is out of bounds |
pre_order()
method descriptor
Deprecated : Use traverse_preorder instead.
quartet_topologies(quartets)
method descriptor
Deprecated : Use quartet_topologies_bulk instead.
quartet_topologies_bulk(quartets: Union[list, np.ndarray]) -> np.ndarray
method descriptor
Bulk processing function for computing quartet topologies. Takes an [N,4] matrix of taxon IDs, where the IDs are in arbitrary order
[ [ a, b, c, d ], [ e, f, g, h ], ... ]
and returns an [N,4] matrix of taxon IDs ordered such that
[ { { a, b }, { c, d } }, { { e, f }, { g, h } }, ... ]
Ordered taxa can be represented as a topology like so :
topology = frozenset( ( frozenset( ( T[i,0], T[i,1] ),
frozenset( ( T[i,2], T[i,3] ) ) ) ) )
Renamed from quartet_topologies() for clarity.
Args quartets : (n, 4) array of node IDs
Returns np.ndarray : (n, 4) array where each row contains ordered node IDs representing the quartet topology
Raises:
| Type | Description |
|---|---|
ValueError
|
If quartets array shape is incorrect |
InvalidNodeError
|
If any node ID is out of bounds |
quartet_topologies_by_name(quartets: List[Tuple[str, str, str, str]]) -> List[frozenset]
method descriptor
Compute quartet topologies for quartets specified by leaf names.
Args quartets : List of tuples containing four leaf names each
Returns List[frozenset] : List of quartet topologies as frozensets
Raises:
| Type | Description |
|---|---|
NodeNotFoundError
|
If any leaf name is not found |
TypeError
|
If input format is incorrect |
quartet_topology(a: Union[int, str], b: Union[int, str], c: Union[int, str], d: Union[int, str]) -> frozenset
method descriptor
Determine the topology of a quartet of taxa.
Renamed from get_quartet_topology() for consistency.
Args ( a, b ), ( c, d ) : Four nodes (IDs or names) forming the quartet
Returns frozenset : Topology as frozenset of two frozensets representing sister pairs
Raises NodeNotFoundError : If any leaf name is not found InvalidNodeError : If any node ID is out of bounds
relationships()
method descriptor
Deprecated : Use to_dataframe instead.
to_networkx_edges(from_node: Union[int, str] = None) -> Generator[Tuple[int, int, Dict[str, Any]], None, None]
method descriptor
Generate edge data compatible with NetworkX.
Renamed from edges_data().
Args from_node : Root node for subtree (default: tree root)
Yields Tuple[ int, int, Dict[ str, Any ] ] : tuples like ( child_id, parent_id, attributes_dict)
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
to_networkx_graph(from_node: Union[int, str] = None)
method descriptor
Create a NetworkX Graph object from the tree.
Args from_node : Root node for subtree (default: tree root)
Returns networkx.Graph : NetworkX graph representation
Raises ImportError : If NetworkX is not installed NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
to_networkx_nodes(from_node: Union[int, str] = None) -> Generator[Tuple[int, Dict[str, Any]], None, None]
method descriptor
Generate node data compatible with NetworkX.
Renamed from nodes_data().
Args from_node : Root node for subtree (default: tree root)
Yields Tuple[ int, Dict[ str, Any ] ] : ( node_id, attributes_dict) pairs
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
to_newick(from_node: Union[int, str] = None, include_support: bool = True, include_distances: bool = True) -> str
method descriptor
Export tree or subtree to Newick format.
Args from_node : Root node for subtree (default: tree root) include_support : Include support values in output include_distances : Include branch lengths in output
Returns str : Newick format string
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
traverse_inorder(include_distances: bool = True) -> Generator[Union[int, Tuple[int, float]], None, None]
method descriptor
Traverse the tree in inorder (left, root, right).
Renamed from in_order().
Args include_distances : If True, yield (node_id, distance_to_parent) tuples If False, yield only node_ids
Yields Union[ int, Tuple[ int, float ] ] : Node ID or (node_id, distance) tuple
traverse_internal_only(from_node: Union[int, str] = None) -> Generator[int, None, None]
method descriptor
Traverse only the internal nodes.
Args from_node : Starting node (default: root)
Yields int : Internal node IDs
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
traverse_leaves_only(from_node: Union[int, str] = None) -> Generator[int, None, None]
method descriptor
Traverse only the leaf nodes.
Args from_node : Starting node (default: root)
Yields int : Leaf node IDs
Raises
NodeNotFoundError : If from_node leaf name is not found
InvalidNodeError : If from_node ID is out of bounds
traverse_levelorder(from_node: Union[int, str] = None) -> Generator[int, None, None]
method descriptor
Traverse the tree level by level (breadth-first).
Args from_node : Starting node (default: root)
Yields int : Node IDs in level order traversal
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
traverse_postorder(from_node: Union[int, str] = None) -> Generator[int, None, None]
method descriptor
Traverse the tree in postorder (left, right, root).
Args from_node : Starting node (default: root)
Yields int : Node IDs in postorder traversal
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
traverse_preorder(from_node: Union[int, str] = None) -> Generator[int, None, None]
method descriptor
Traverse the tree in preorder (root, left, right).
Renamed from pre_order(), plus new from_node parameter.
Args from_node : Starting node (default: root)
Yields int : Node IDs in preorder traversal
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
traverse_with_depth(from_node: Union[int, str] = None) -> Generator[Tuple[int, int], None, None]
method descriptor
Traverse the tree with depth information.
Args from_node : Starting node (default: root)
Yields Tuple[int, int] : (node_id, depth) pairs
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
traverse_with_distances(from_node: Union[int, str] = None) -> Generator[Tuple[int, float, float], None, None]
method descriptor
Traverse the tree with distance information.
Args from_node : Starting node (default: root)
Yields Tuple[ int, float, float ] : tuples ( node_id, distance_to_parent, distance_to_root)
Raises NodeNotFoundError : If from_node leaf name is not found InvalidNodeError : If from_node ID is out of bounds
SuchTree.SuchLinkedTrees
Initialize self. See help(type(self)) for accurate signature.
Attributes
TreeA
property
first tree initialized by SuchLinkedTrees( TreeA, TreeB )
TreeB
property
second tree initialized by SuchLinkedTrees( TreeA, TreeB )
col_ids
property
ids of the columns (TreeB) in the link matrix.
col_names
property
Names of the columns (TreeB) in the link matrix.
linklist
property
numpy representation of link list
linkmatrix
property
numpy representation of link matrix (generated only on access)
n_cols
property
Number of columns in the link matrix.
n_links
property
size of the link list
n_rows
property
Number of rows in the link matrix.
row_ids
property
ids of the rows (TreeA) in the link matrix.
row_names
property
Names of the rows (TreeA) in the link matrix.
subset_a_leafs
property
ids of the current subset rows.
subset_a_root
property
ID of the current subset root in TreeA.
subset_a_size
property
Number of rows in the current subset.
subset_b_leafs
property
ids of the current subset columns.
subset_b_root
property
ID of the current subset root in TreeB.
subset_b_size
property
Number of columns in the current subset.
subset_columns
property
ids of the current subset columns.
subset_n_links
property
Number of links in the current subset.
Functions
adjacency(deletions=0, additions=0, swaps=0)
method descriptor
Build the graph adjacency matrix of the current subsetted trees, applying the specified random permutaitons.
dump_table()
method descriptor
Print the link matrix (WARNING : may be huge and useless)
laplacian(deletions=0, additions=0, swaps=0)
method descriptor
The graph Laplacian matrix of the current subsetted trees.
linked_distances()
method descriptor
Compute distances for all pairs of links. For large link tables, this will fail on memory allocation.
spectrum(deletions=0, additions=0, swaps=0)
method descriptor
The eigenvalues of the graph Laplacian matrix of the current subsetted trees.
subset_a(node_id)
method descriptor
subset the link matrix to leafs desended from node_id in TreeA
subset_b(node_id)
method descriptor
subset the link matrix to leafs desended from node_id in TreeB
to_igraph(deletions=0, additions=0, swaps=0)
method descriptor
Return the current SuchLinkedTrees subgraph as a weighted, labled igraph object. The igraph package must be installed.
SuchTree.exceptions
SuchTreeError
Bases: Exception
Base exception class errors.
NodeNotFoundError(node, message=None)
Bases: SuchTreeError
Raised when a node ID or leaf name is not found in the tree.
Source code in SuchTree/exceptions.py
8 9 10 11 12 13 14 15 | |
InvalidNodeError(node_id, tree_size=None, message=None)
Bases: SuchTreeError
Raised when a node ID is out of bounds or invalid.
Source code in SuchTree/exceptions.py
20 21 22 23 24 25 26 27 28 29 30 31 32 | |
TreeStructureError
Bases: SuchTreeError
Raised when tree structure is invalid or inconsistent.