Skip to content
Snippets Groups Projects
Commit 06daec9d authored by Lukas Müller's avatar Lukas Müller
Browse files

Started on correct logging

Former-commit-id: 424465f94b0e88b4b0107ddefd4146df292d6ff4
parent 80530658
No related branches found
No related tags found
No related merge requests found
Pipeline #192599 canceled
Showing
with 4177 additions and 4170 deletions
......@@ -2955,8 +2955,8 @@ class KadmosGraph(nx.DiGraph):
logger.info('Saving the ' + file_type.upper() + ' file ' + file_path + '...')
if file_type == 'cmdows':
self._save_cmdows(file_path, description=description, creator=creator, version=version,
timestamp=timestamp, mpg=mpg, keep_empty_elements=keep_empty_elements,
pretty_print=pretty_print)
timestamp=timestamp, mpg=mpg, keep_empty_elements=keep_empty_elements,
pretty_print=pretty_print)
elif file_type == 'kdms':
self._save_kdms(file_path)
if mpg is not None:
......@@ -3031,7 +3031,7 @@ class KadmosGraph(nx.DiGraph):
cmdows_executable_blocks = Child(cmdows, 'executableBlocks')
# Create executableBlocks/designCompetences
cmdows_design_competences = Child(cmdows_executable_blocks, 'designCompetences')
graph_design_competences = graph.find_all_nodes(category='function', attr_exclude=['architecture_role',self.CMDOWS_ARCHITECTURE_ROLE_SPLITTER])
graph_design_competences = graph.find_all_nodes(category='function', attr_exclude=['architecture_role', self.CMDOWS_ARCHITECTURE_ROLE_SPLITTER])
for graph_designCompetence in graph_design_competences:
# Create executableBlocks/designCompetences/designCompetence
cmdows_design_competence = Child(cmdows_design_competences, 'designCompetence')
......@@ -3277,7 +3277,7 @@ class KadmosGraph(nx.DiGraph):
transform_data_into_strings(G.graph)
for node, data in G.nodes_iter(data=True):
transform_data_into_strings(data, keys_to_be_removed=keys_to_be_removed)
for u,v,data in G.edges(data=True):
for u, v, data in G.edges(data=True):
transform_data_into_strings(data)
 
# Write graphml file
......@@ -5556,6 +5556,9 @@ class FundamentalProblemGraph(KadmosGraph):
:return: result of the check
:rtype: bool
"""
logger.info('Checking FPG...')
# Set check
nodes_check = True
formulation_check = True
......@@ -6424,6 +6427,8 @@ class FundamentalProblemGraph(KadmosGraph):
:rtype: FundamentalProblemGraph
"""
 
logger.info('Adding function problem roles...')
# Determine and check function ordering method
assert function_order_method in self.OPTIONS_FUNCTION_ORDER_METHOD
if function_order_method == 'manual':
......@@ -6495,10 +6500,8 @@ class FundamentalProblemGraph(KadmosGraph):
"""
 
# start-up checks
print 'Composing FPG...'
print 'Add function problem roles...'
logger.info('Composing MPG...')
self.add_function_problem_roles()
print 'Check FPG...'
self.check(print_in_log=False, raise_error_if_false=True)
 
# Make clean copy of the graph to avoid unwanted links and updates
......@@ -6654,6 +6657,9 @@ class FundamentalProblemGraph(KadmosGraph):
mpg.add_parallel_process(conv, post_functions, mpg.node[conv]['converger_step'],
end_node=doe, end_in_converger=True, use_data_graph=None)
mpg.connect_nested_iterators(coor, doe)
logger.info('Composed MPG.')
return mpg
 
def get_mdg(self, name='MDG'):
......@@ -6667,11 +6673,9 @@ class FundamentalProblemGraph(KadmosGraph):
"""
 
# start-up checks
print 'Composing MDG...'
logger.info('Composing MDG...')
assert isinstance(name, basestring), 'Input name should be a string.'
print 'Add function problem roles...'
self.add_function_problem_roles()
print 'Check FPG...'
self.check(print_in_log=False, raise_error_if_false=True)
 
# Make clean copy of the graph to avoid unwanted links and updates
......@@ -6782,6 +6786,9 @@ class FundamentalProblemGraph(KadmosGraph):
mdg.connect_doe_block(doe, des_var_nodes, qoi_nodes)
# Connect remaining system inputs and outputs to the coordinator
mdg.connect_coordinator()
logger.info('Composed MDG.')
return mdg
 
class MdaoProcessGraph(KadmosGraph):
......
No preview for this file type
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-04-24T11:31:28.837000</timestamp>
<timestamp>2017-04-24T12:39:34.738000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.4</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-04-24T11:31:28.837000</timestamp>
<timestamp>2017-04-24T12:39:34.738000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.4</cmdowsVersion>
</update>
......
No preview for this file type
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-04-24T11:31:28.837000</timestamp>
<timestamp>2017-04-24T12:39:34.738000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.4</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-04-24T11:31:28.837000</timestamp>
<timestamp>2017-04-24T12:39:34.738000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.4</cmdowsVersion>
</update>
......
No preview for this file type
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-04-24T11:31:28.837000</timestamp>
<timestamp>2017-04-24T12:39:34.738000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.4</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-04-24T11:31:28.837000</timestamp>
<timestamp>2017-04-24T12:39:34.738000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.4</cmdowsVersion>
</update>
......
No preview for this file type
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-04-24T11:31:28.837000</timestamp>
<timestamp>2017-04-24T12:39:34.738000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.4</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-04-24T11:31:28.837000</timestamp>
<timestamp>2017-04-24T12:39:34.738000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.4</cmdowsVersion>
</update>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment