wholecell.utils.dependency_graph
Tools for working with dependency graphs
- class wholecell.utils.dependency_graph.DependencyGraph[source]
Bases:
object
Represents a dependency graph
- dependencies
Mapping from node to that node’s dependents
Initialize dependencies to empty dictionary
- add_dep_relation(a, b)[source]
Add an edge such that a depends on b
If a or b does not exist yet as a node, it will be created.
- get_topological_ordering()[source]
Get a topological ordering of the nodes
- Returns:
List of dependency names such that the dependencies can be loaded in the order in which they appear in the list without violating dependency relationships.
- Raises:
InvalidDependencyGraphError – If the graph contains a cycle
- Return type: