gemseo / core

Hide inherited members

dependency_graph module

Graphs of the disciplines dependencies and couplings.

class gemseo.core.dependency_graph.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[MDODiscipline]) – The disciplines to build the graph with.

export_initial_graph(file_path)

Write a representation of the full graph.

Parameters:

file_path (str) – A path to the file.

Returns:

The full graph or None otherwise.

Return type:

GraphView | None

export_reduced_graph(file_path)

Write a representation of the condensed graph.

Parameters:

file_path (str) – A path to the file.

Returns:

The condensed graph or None otherwise.

Return type:

GraphView | None

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[MDODiscipline, MDODiscipline, list[str]]]

get_execution_sequence()[source]

Compute the execution sequence of the disciplines.

Returns:

The execution sequence.

Return type:

list[list[tuple[MDODiscipline, …]]]

write_condensed_graph(file_path)[source]

Write a representation of the condensed graph.

Parameters:

file_path (str) – A path to the file.

Returns:

The condensed graph or None otherwise.

Return type:

GraphView | None

write_full_graph(file_path)[source]

Write a representation of the full graph.

Parameters:

file_path (str) – A path to the file.

Returns:

The full graph or None otherwise.

Return type:

GraphView | None

property disciplines: Iterator[MDODiscipline]

The disciplines used to build the graph.

property graph: DiGraph

The disciplines data graph.