gemseo.core.dependency_graph module#
Graphs of the disciplines dependencies and couplings.
- class DependencyGraph(disciplines)[source]#
Bases:
object
Graph of dependencies between disciplines.
This class can create the sequence of execution of the disciplines. This is done by determining the strongly connected components (scc) of the graph. The disciplines in the components of a scc have the same order as in the passed disciplines passed when instantiating the class.
The couplings between the disciplines can also be computed.
- Parameters:
disciplines (Sequence[Discipline]) -- The disciplines to build the graph with.
- get_disciplines_couplings()[source]#
Return the couplings between the disciplines.
- Returns:
The disciplines couplings, a coupling is composed of a discipline, one of its successor and the sorted variables names.
- Return type:
list[tuple[Discipline, Discipline, list[str]]]
- get_execution_sequence()[source]#
Compute the execution sequence of the disciplines.
- Returns:
The execution sequence.
- Return type:
list[list[tuple[Discipline, ...]]]
- render_condensed_graph(file_path)[source]#
Render the condensed graph.
- Parameters:
file_path (str | Path) -- The file path to save the graphical representation of the condensed graph. If empty, the graphical representation is not saved.
- Returns:
Either the condensed graph or
None
when graphviz is not installed.- Return type:
GraphView | None
- render_full_graph(file_path)[source]#
Render the full graph.
- Parameters:
file_path (str | Path) -- The file path to save the graphical representation of the full graph. If empty, the graphical representation is not saved.
- Returns:
Either the full graph or
None
when graphviz is not installed.- Return type:
GraphView | None
- property disciplines: Iterator[Discipline]#
The disciplines used to build the graph.