gemseo / core

# dependency_graph module¶

Graphs of the disciplines dependencies and couplings.

Classes:

 DependencyGraph(disciplines) Graph of dependencies between disciplines.
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 – The disciplines to build the graph with.

Attributes:

 disciplines The disciplines used to build the graph.

Methods:

 export_initial_graph(file_path) Write a representation of the full graph. export_reduced_graph(file_path) Write a representation of the condensed graph. Return the couplings between the disciplines. Compute the execution sequence of the disciplines. write_condensed_graph(file_path) Write a representation of the condensed graph. write_full_graph(file_path) Write a representation of the full graph.
property disciplines

The disciplines used to build the graph.

export_initial_graph(file_path)

Write a representation of the full graph.

Parameters

file_path (str) – A path to the file.

export_reduced_graph(file_path)

Write a representation of the condensed graph.

Parameters

file_path (str) – A path to the file.

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 of tuples

get_execution_sequence()[source]

Compute the execution sequence of the disciplines.

Returns

list(set(tuple(set(MDODisciplines))))

write_condensed_graph(file_path)[source]

Write a representation of the condensed graph.

Parameters

file_path (str) – A path to the file.

write_full_graph(file_path)[source]

Write a representation of the full graph.

Parameters

file_path (str) – A path to the file.