graph
tergite_autocalibration.lib.utils.graph
Functions:
| Name | Description |
|---|---|
filtered_topological_order |
Get the graph in topological order. |
get_dependencies_in_topological_order |
Get dependencies of a graph in topological order. |
range_dependencies_in_topological_order |
Get a subset of the graph in topological order. |
filtered_topological_order
filtered_topological_order(target_node: str, from_nodes: Optional[Union[str, List[str]]] = None) -> List[str]
Get the graph in topological order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_node
|
str
|
Target node to end at. |
required |
from_nodes
|
Optional[Union[str, List[str]]]
|
Option to define a range in between. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: Topological order of nodes including target node |
get_dependencies_in_topological_order
get_dependencies_in_topological_order(graph: DiGraph, target_node: str, exclude_nodes: Optional[List[str]] = None) -> List[str]
Get dependencies of a graph in topological order. This implementation takes into account that there might be parallel dependencies. The dependency information from excluded nodes will be respected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
DiGraph
|
Graph to get dependencies from. |
required |
target_node
|
str
|
Target node to request dependencies from. |
required |
exclude_nodes
|
Optional[List[str]]
|
Nodes that should be excluded from the dependency search. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: A list of nodes in topological order. |
range_dependencies_in_topological_order
range_dependencies_in_topological_order(graph: DiGraph, from_nodes: List[str], target_node: str, exclude_nodes: Optional[List[str]] = None) -> List[str]
Get a subset of the graph in topological order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
DiGraph
|
Graph to get dependencies from. |
required |
from_nodes
|
List[str]
|
Nodes to start from. |
required |
target_node
|
str
|
End range node. |
required |
exclude_nodes
|
Optional[List[str]]
|
Nodes that should be excluded from the dependency search. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: A topologically ordered subset of the all nodes including from_nodes. |