diff --git a/kadmos/graph/graph_data.py b/kadmos/graph/graph_data.py index 1fd9a02cbe31325212a61bf5dfd14ed20ad9ca1a..3ba33abdee265216d877d98d2a79f0d0439aec9a 100644 --- a/kadmos/graph/graph_data.py +++ b/kadmos/graph/graph_data.py @@ -2674,6 +2674,17 @@ class FundamentalProblemGraph(DataGraph, KeChainMixin): return mdg + def impose_mdao_architecture(self): + """ + Method to directly get both the MDG and MPG of an FPG. + + :return: MdaoDataGraph and MdaoProcessGraph + :rtype: tuple + """ + mdg = self.get_mdg() + mpg = mdg.get_mpg() + return mdg, mpg + class MdaoDataGraph(DataGraph, MdaoMixin): diff --git a/kadmos/graph/graph_kadmos.py b/kadmos/graph/graph_kadmos.py index fe73b299f2a83a173a954eea5d3824d9a1cb0fd1..1683140eb3300a166e6732b1480cef9f8b3e524a 100644 --- a/kadmos/graph/graph_kadmos.py +++ b/kadmos/graph/graph_kadmos.py @@ -3140,8 +3140,10 @@ class KadmosGraph(nx.DiGraph, EquationMixin, VistomsMixin): function_order = source_funcs + new_targets # Assert that the function order given matches with the sources and targets - assert set(source_funcs).issubset(function_order), 'Some node sources are missing in the function order.' - assert set(target_funcs).issubset(function_order), 'Some node targets are missing in the function order.' + assert set(source_funcs).issubset(function_order), \ + 'Some node sources {} are missing in the function order {}.'.format(source_funcs, function_order) + assert set(target_funcs).issubset(function_order), \ + 'Some node targets {} are missing in the function order {}.'.format(target_funcs, function_order) # Make a first new node idx = 1 @@ -3217,8 +3219,8 @@ class KadmosGraph(nx.DiGraph, EquationMixin, VistomsMixin): """ # Input assertions - assert self.has_node(function), 'Node %s not present in the graph.' - assert self.node[function]['category'] == 'function', 'Node %s should be of category function.' + assert self.has_node(function), 'Node {} not present in the graph.'.format(function) + assert self.node[function]['category'] == 'function', 'Node {} should be of category function.'.format(function) assert isinstance(disconnect_collided_targets, bool) assert isinstance(disconnect_shared_sources, bool) assert isinstance(ignore_list, list)