]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Le cas ASTER est de nouveau ok
authorAndré Ribes <andre.ribes@edf.fr>
Thu, 24 Mar 2011 16:26:34 +0000 (17:26 +0100)
committerAndré Ribes <andre.ribes@edf.fr>
Thu, 24 Mar 2011 16:26:34 +0000 (17:26 +0100)
resources/ADAOSchemaCatalog.xml
src/daSalome/daYacsSchemaCreator/help_methods.py
src/daSalome/daYacsSchemaCreator/methods.py

index 85688d01bfbf8dc77aa6b136a1e0b586f2c5d9f4..703ee5c733627d5eae6be722f8f8a10c0c3a8265 100644 (file)
@@ -205,9 +205,9 @@ execfile(script)
     <inport name="script" type="string"/>
   </inline>
 
-  <inline name="InitUserDataFromScript">
+  <inline name="UserDataInitFromScript">
     <script><code><![CDATA[
-print "Entering in InitUserDataFromScript"
+print "Entering in UserDataInitFromScript"
 execfile(script)
 ]]></code></script>
     <inport name="script" type="string"/>
index 530fc4747af25cc44d9132f4739f66c7f10e9643..0537af0b3d3a9161d120f7aebd0e771caf96485c 100644 (file)
@@ -40,7 +40,7 @@ def check_study(study_config):
   if not isinstance(study_config, dict):
     logging.fatal("Study configuration is not a dictionnary")
     sys.exit(1)
-  
+
   # Name
   if "Name" not in study_config:
     logging.fatal("Cannot found Name in the study configuration")
@@ -56,6 +56,10 @@ def check_study(study_config):
                     "\n You can choose between : " + str(AssimAlgos))
       sys.exit(1)
 
+  # Debug
+  if "Debug" not in study_config:
+    study_config["Debug"] = "0"
+
   # Check if all the data is provided
   for key in AlgoDataRequirements[study_config["Algorithm"]]:
     if key not in study_config.keys():
@@ -70,10 +74,10 @@ def check_study(study_config):
       check_data(key, study_config[key])
 
   # Analyse
-  if "Analysis" in study_config.keys():
-    analysis_config = study_config["Analysis"]
+  if "UserPostAnalysis" in study_config.keys():
+    analysis_config = study_config["UserPostAnalysis"]
     if "From" not in analysis_config:
-      logging.fatal("Analysis found but From is not defined in the analysis configuration !")
+      logging.fatal("UserPostAnalysis found but From is not defined in the analysis configuration !")
       sys.exit(1)
     else:
       if analysis_config["From"] not in AnalysisFromList:
index c48e73a69e05544801d0b8b5cb8dbce7813db8df..b31b6916f92fa35dd2a9dd327555bbcd5bda6a70 100644 (file)
@@ -61,10 +61,10 @@ def create_yacs_proc(study_config):
   # Step 0.5: Find if there is a user init node
   init_config = {}
   init_config["Target"] = []
-  if "Init" in study_config.keys():
-    init_config = study_config["Init"]
-    factory_init_node = catalogAd._nodeMap["InitUserDataFromScript"]
-    init_node = factory_init_node.cloneNode("InitUserData")
+  if "UserDataInit" in study_config.keys():
+    init_config = study_config["UserDataInit"]
+    factory_init_node = catalogAd._nodeMap["UserDataInitFromScript"]
+    init_node = factory_init_node.cloneNode("UserDataInit")
     init_node.getInputPort("script").edInitPy(init_config["Data"])
     proc.edAddChild(init_node)
 
@@ -169,13 +169,6 @@ def create_yacs_proc(study_config):
   proc.edAddChild(compute_bloc)
   proc.edAddCFLink(CAS_node, compute_bloc)
 
-  if AlgoType[study_config["Algorithm"]] == "Direct":
-    # We don't need to use an optimizer loop
-    factory_execute_node = catalogAd._nodeMap["SimpleExecuteDirectAlgorithm"]
-    execute_node = factory_execute_node.cloneNode("Execute" + study_config["Algorithm"])
-    compute_bloc.edAddChild(execute_node)
-    proc.edAddDFLink(CAS_node.getOutputPort("Study"), execute_node.getInputPort("Study"))
-
   if AlgoType[study_config["Algorithm"]] == "Optim":
     # We use an optimizer loop
     name = "Execute" + study_config["Algorithm"]
@@ -239,11 +232,11 @@ def create_yacs_proc(study_config):
       proc.edAddDFLink(opt_script_node.getOutputPort("result"), optimizer_node.edGetPortForOutPool())
 
   # Step 4: create post-processing from user configuration
-  if "Analysis" in study_config.keys():
-    analysis_config = study_config["Analysis"]
+  if "UserPostAnalysis" in study_config.keys():
+    analysis_config = study_config["UserPostAnalysis"]
     if analysis_config["From"] == "String":
       factory_analysis_node = catalogAd._nodeMap["SimpleUserAnalysis"]
-      analysis_node = factory_analysis_node.cloneNode("UseAnalysis")
+      analysis_node = factory_analysis_node.cloneNode("UsePostAnalysis")
       default_script = analysis_node.getScript()
       final_script = default_script + analysis_config["Data"]
       analysis_node.setScript(final_script)
@@ -255,13 +248,13 @@ def create_yacs_proc(study_config):
         proc.edAddDFLink(execute_node.getOutputPort("Study"), analysis_node.getInputPort("Study"))
 
       # Connect node with InitUserData
-      if "Analysis" in init_config["Target"]:
+      if "UserPostAnalysis" in init_config["Target"]:
         analysis_node.edAddInputPort("init_data", t_pyobj)
         proc.edAddDFLink(init_node.getOutputPort("init_data"), analysis_node.getInputPort("init_data"))
 
     elif analysis_config["From"] == "Script":
       factory_analysis_node = catalogAd._nodeMap["SimpleUserAnalysis"]
-      analysis_node = factory_analysis_node.cloneNode("User Analysis")
+      analysis_node = factory_analysis_node.cloneNode("UserPostAnalysis")
       default_script = analysis_node.getScript()
       if not os.path.exists(analysis_config["Data"]):
         logging.fatal("Analysis source file does not exists ! :" + str(analysis_config["Data"]))
@@ -282,7 +275,7 @@ def create_yacs_proc(study_config):
       else:
         proc.edAddDFLink(execute_node.getOutputPort("Study"), analysis_node.getInputPort("Study"))
       # Connect node with InitUserData
-      if "Analysis" in init_config["Target"]:
+      if "UserPostAnalysis" in init_config["Target"]:
         analysis_node.edAddInputPort("init_data", t_pyobj)
         proc.edAddDFLink(init_node.getOutputPort("init_data"), analysis_node.getInputPort("init_data"))