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

Added "architectureElements/executableBlocks/...Analyses/..." to save_as_cmdows

Former-commit-id: b3eb2d43880a17d75db69c44162fec9b657e1abf
parent 5b09494c
No related branches found
No related tags found
No related merge requests found
Showing
with 105 additions and 43 deletions
......@@ -2945,7 +2945,7 @@ class KadmosGraph(nx.DiGraph):
# Create header/update
cmdows_updates = Child(cmdows_header, 'updates')
# Create header/updates/update
# TODO: Check for existing updates and append
# TODO: Check for existing updates and append accordingly
cmdows_update = Child(cmdows_updates, 'update')
Child(cmdows_update, 'modification', modification)
Child(cmdows_update, 'creator', creator)
......@@ -2986,9 +2986,8 @@ class KadmosGraph(nx.DiGraph):
# Create executableBlocks/designCompetences/designCompetence/metadata/generalInfo
cmdows_generalInfo = Child(cmdows_metadata, 'generalInfo')
Child(cmdows_generalInfo, 'version')
# TODO: Add creator and specialist
#cmdows_creator = Child(cmdows_generalInfo, 'creator')
#cmdows_specialist = Child(cmdows_generalInfo, 'specialist')
cmdows_creator = Child(cmdows_generalInfo, 'creator')
cmdows_specialist = Child(cmdows_generalInfo, 'specialist')
Child(cmdows_generalInfo, 'description', graph_data.get('description'))
# Create executableBlocks/designCompetences/designCompetence/metadata/performanceInfo
cmdows_performanceInfo = Child(cmdows_metadata, 'performanceInfo')
......@@ -3069,7 +3068,7 @@ class KadmosGraph(nx.DiGraph):
# Create workflow/problemDefinitionUID
Child(cmdows_workflow, 'problemDefinitionUID',
str(graph_problemFormulation.get('mdao_architecture'))+
str(graph_problemFormulation.get('convergence_type'))) # TODO: Change if applicable
str(graph_problemFormulation.get('convergence_type')))
# Create workflow/dataGraph
cmdows_dataGraph = Child(cmdows_workflow, 'dataGraph')
Child(cmdows_dataGraph, 'name', graph.graph.get('name'))
......@@ -3133,7 +3132,14 @@ class KadmosGraph(nx.DiGraph):
['settings', 'settings']]
cmdows_executableBlocks.append(ChildGroup(graph, 'architecture_role',
architecture_roles_fun, data_list))
# TODO: Add anaylses
# Create architectureElements/executableBlocks/...Analyses/...
architecture_roles_funs = np.setdiff1d(self.ARCHITECTURE_ROLES_FUNS, self.CMDOWS_ARCHITECTURE_ROLE_SPLITTER, assume_unique=True)
for architecture_roles_fun in architecture_roles_funs:
nodes = graph.find_all_nodes(attr_cond=['architecture_role', '==', str(architecture_roles_fun)])
cmdows_analyses = Child(cmdows_executableBlocks, make_camel_case(architecture_roles_fun, make_plural=True))
for node in nodes:
cmdows_analysis = Child(cmdows_analyses, make_camel_case(architecture_roles_fun))
Child(cmdows_analysis, 'relatedExecutableBlockUID', node)
 
# Check destination folder
if destination_folder:
......@@ -4177,6 +4183,9 @@ def cmdows_integrity_check(graph, MPG=None, print_result=True):
check.save_as_cmdows('testfile2', 'test description', 'test author', '1.1', timestamp=timestamp, kadmos_check_critical = False)
result_a = filecmp.cmp('testfile1.xml', 'testfile2.xml')
 
#print graph.__dict__
#print check.__dict__
# Check if the file adheres to the schema
try:
file = etree.parse('testfile1.xml')
......
......@@ -62,7 +62,6 @@ function_order = ['D1', 'D2', 'D3', 'F', 'F2', 'G1', 'G2']
RCG.create_dsm(filename='RCG', function_order=function_order, include_system_vars=True, open_pdf=open_pdfs,
destination_folder=pdfs_folder)
# Save graph
RCG.save_as_cmdows('RCG', 'Test RCG file', 'Imco van Gent', '0.1', destination_folder=pdfs_folder, pretty_print=True)
cmdows_integrity_check(RCG)
......@@ -104,9 +103,6 @@ for mdao_definition in mdao_definitions:
# Reset FPG (required for looping)
FPG = FPG.cleancopy()
# Set file name for output files
file_name = 'sellarProblem_' + mdao_definition
# Store the problem formulation at the required positions in the FPG
FPG.graph['problem_formulation'] = dict()
FPG.graph['problem_formulation']['function_order'] = function_order
......@@ -184,14 +180,14 @@ for mdao_definition in mdao_definitions:
MDG = FPG.get_mdg(name='MDG Sellar problem')
# Create XDSM
MDG.create_xdsm(MPG, file_name, open_pdf=open_pdfs, destination_folder=pdfs_folder)
MDG.create_xdsm(MPG, 'MDAO_'+mdao_definition, open_pdf=open_pdfs, destination_folder=pdfs_folder)
# Plot graphs
MPG.plot_graph(10, color_setting='default', fig_size=fig_size, show_now=False)
MDG.plot_graph(11, color_setting='default', fig_size=fig_size, show_now=False)
# Save graph
MDG.save_as_cmdows('MPG_'+mdao_definition, 'Test MPG file', 'Imco van Gent', '0.1', MPG=MPG,
MDG.save_as_cmdows('MDAO_'+mdao_definition, 'Test MDAO file', 'Imco van Gent', '0.1', MPG=MPG,
destination_folder=pdfs_folder, pretty_print=True)
#cmdows_integrity_check(MDG, MPG=MPG)
......
No preview for this file type
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -3,14 +3,14 @@
<header>
<creator>Imco van Gent</creator>
<description>Test FPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS export of a fundamental problem graph (FPG).</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......
......@@ -2,15 +2,15 @@
<cmdows xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://bitbucket.org/imcovangent/cmdows/raw/master/schema/0.3/cmdows.xsd">
<header>
<creator>Imco van Gent</creator>
<description>Test MPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<description>Test MDAO file</description>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS Export of a mdao data graph (MDG) graph.</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......@@ -740,6 +740,25 @@
<label>Gc</label>
</consistencyConstraintFunction>
</consistencyConstraintFunctions>
<coupledAnalyses>
<coupledAnalysis>
<relatedExecutableBlockUID>D2</relatedExecutableBlockUID>
</coupledAnalysis>
<coupledAnalysis>
<relatedExecutableBlockUID>D1</relatedExecutableBlockUID>
</coupledAnalysis>
</coupledAnalyses>
<postCouplingAnalyses>
<postCouplingAnalysis>
<relatedExecutableBlockUID>G2</relatedExecutableBlockUID>
</postCouplingAnalysis>
<postCouplingAnalysis>
<relatedExecutableBlockUID>G1</relatedExecutableBlockUID>
</postCouplingAnalysis>
<postCouplingAnalysis>
<relatedExecutableBlockUID>F</relatedExecutableBlockUID>
</postCouplingAnalysis>
</postCouplingAnalyses>
</executableBlocks>
</architectureElements>
</cmdows>
......@@ -2,15 +2,15 @@
<cmdows xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://bitbucket.org/imcovangent/cmdows/raw/master/schema/0.3/cmdows.xsd">
<header>
<creator>Imco van Gent</creator>
<description>Test MPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<description>Test MDAO file</description>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS Export of a mdao data graph (MDG) graph.</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......@@ -641,6 +641,25 @@
<label>CONV</label>
</converger>
</convergers>
<coupledAnalyses>
<coupledAnalysis>
<relatedExecutableBlockUID>D2</relatedExecutableBlockUID>
</coupledAnalysis>
<coupledAnalysis>
<relatedExecutableBlockUID>D1</relatedExecutableBlockUID>
</coupledAnalysis>
</coupledAnalyses>
<postCouplingAnalyses>
<postCouplingAnalysis>
<relatedExecutableBlockUID>G2</relatedExecutableBlockUID>
</postCouplingAnalysis>
<postCouplingAnalysis>
<relatedExecutableBlockUID>G1</relatedExecutableBlockUID>
</postCouplingAnalysis>
<postCouplingAnalysis>
<relatedExecutableBlockUID>F</relatedExecutableBlockUID>
</postCouplingAnalysis>
</postCouplingAnalyses>
</executableBlocks>
</architectureElements>
</cmdows>
......@@ -2,15 +2,15 @@
<cmdows xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://bitbucket.org/imcovangent/cmdows/raw/master/schema/0.3/cmdows.xsd">
<header>
<creator>Imco van Gent</creator>
<description>Test MPG file</description>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<description>Test MDAO file</description>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
<updates>
<update>
<modification>KADMOS Export of a mdao data graph (MDG) graph.</modification>
<creator>Imco van Gent</creator>
<timestamp>2017-03-24T13:11:34.466000</timestamp>
<timestamp>2017-03-24T19:32:19.059000</timestamp>
<fileVersion>0.1</fileVersion>
<cmdowsVersion>0.3</cmdowsVersion>
</update>
......@@ -681,6 +681,25 @@
<label>CONV</label>
</converger>
</convergers>
<coupledAnalyses>
<coupledAnalysis>
<relatedExecutableBlockUID>D2</relatedExecutableBlockUID>
</coupledAnalysis>
<coupledAnalysis>
<relatedExecutableBlockUID>D1</relatedExecutableBlockUID>
</coupledAnalysis>
</coupledAnalyses>
<postCouplingAnalyses>
<postCouplingAnalysis>
<relatedExecutableBlockUID>G2</relatedExecutableBlockUID>
</postCouplingAnalysis>
<postCouplingAnalysis>
<relatedExecutableBlockUID>G1</relatedExecutableBlockUID>
</postCouplingAnalysis>
<postCouplingAnalysis>
<relatedExecutableBlockUID>F</relatedExecutableBlockUID>
</postCouplingAnalysis>
</postCouplingAnalyses>
</executableBlocks>
</architectureElements>
</cmdows>
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