]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Mode Debug OK
authorAndré Ribes <andre.ribes@edf.fr>
Thu, 24 Mar 2011 20:36:46 +0000 (21:36 +0100)
committerAndré Ribes <andre.ribes@edf.fr>
Thu, 24 Mar 2011 20:36:46 +0000 (21:36 +0100)
Il faudra faire plus

resources/ADAOSchemaCatalog.xml
src/daEficas/generator_adao.py
src/daSalome/daYacsIntegration/daOptimizerLoop.py
src/daSalome/daYacsIntegration/daStudy.py
src/daSalome/daYacsSchemaCreator/methods.py

index 703ee5c733627d5eae6be722f8f8a10c0c3a8265..823c011dddf10e22faa8abf7c51769791ccbe4e6 100644 (file)
@@ -13,10 +13,11 @@ import numpy
 print "Entering in CreateAssimilationStudy"
 print "Name is", Name
 print "Algorithm is", Algorithm
+print "Debug is set to", Debug
 
 # Create Assimilation study
 from daYacsIntegration.daStudy import *
-assim_study = daStudy(Name, Algorithm)
+assim_study = daStudy(Name, Algorithm, Debug)
 
 # Algorithm parameters
 try:
@@ -116,6 +117,7 @@ Study = assim_study
 </code></script>
     <inport name="Name" type="string"/>
     <inport name="Algorithm" type="string"/>
+    <inport name="Debug" type="bool"/>
     <outport name="Study" type="pyobj"/>
   </inline>
 
index 0a94146b8769b477280941d04cfb4360001333a6..6146f62c9b18e0def5c9f72663ce7be3771f1334 100644 (file)
@@ -232,6 +232,6 @@ class AdaoGenerator(PythonGenerator):
         self.text_da += "outputvariables_config[\"%s\"] = %s \n" % (name,size)
       self.text_da += "study_config[\"OutputVariables\"] = outputvariables_config \n"
     else:
-      self.text_da += "variables_config = {} \n"
+      self.text_da += "outputvariables_config = {} \n"
       self.text_da += "outputvariables_config[\"adao_default\"] = -1 \n"
-      self.text_da += "study_config[\"OutputVariables\"] = ouputvariables_config \n"
+      self.text_da += "study_config[\"OutputVariables\"] = outputvariables_config \n"
index 9e86cd8b89c6e2e1d7044be92bfd7f794abbaf1e..1ea9a60e0f73e7c4a4ecc19f8b55196a9e6e1831 100644 (file)
@@ -187,9 +187,6 @@ class AssimilationAlgorithm_asynch(SALOMERuntime.OptimizerAlgASync):
 
 
     # Start Assimilation Study
-    import logging
-    logging.getLogger().setLevel(logging.DEBUG)
-
     print "ADD analyze"
     self.ADD.analyze()
 
index ed685c0cd1ead81d5cfbe761aa7e7015bdd75ae3..bc630737032448c1b2eb8909ed5c849adb3c218e 100644 (file)
@@ -1,6 +1,7 @@
 #-*- coding: utf-8 -*-
 
 from daCore.AssimilationStudy import AssimilationStudy
+from daCore import Logging
 
 class daError(Exception):
   def __init__(self, value):
@@ -10,7 +11,7 @@ class daError(Exception):
 
 class daStudy:
 
-  def __init__(self, name, algorithm):
+  def __init__(self, name, algorithm, debug):
 
     self.ADD = AssimilationStudy(name)
     self.ADD.setControls()
@@ -18,6 +19,14 @@ class daStudy:
     self.algorithm_dict = None
     self.Background = None
 
+    self.debug = debug
+    import logging
+    if self.debug:
+      logging.getLogger().setLevel(logging.DEBUG)
+    else:
+      logging.getLogger().setLevel(logging.INFO)
+
+
     # Observation Management
     self.ObservationOperatorType = {}
     self.FunctionObservationOperator = {}
index b31b6916f92fa35dd2a9dd327555bbcd5bda6a70..d9922b1889fa2dca253a8aaf1d80007541987a98 100644 (file)
@@ -56,6 +56,10 @@ def create_yacs_proc(study_config):
   CAS_node = factory_CAS_node.cloneNode("CreateAssimilationStudy")
   CAS_node.getInputPort("Name").edInitPy(study_config["Name"])
   CAS_node.getInputPort("Algorithm").edInitPy(study_config["Algorithm"])
+  if study_config["Debug"] == "0":
+    CAS_node.getInputPort("Debug").edInitPy(False)
+  else:
+    CAS_node.getInputPort("Debug").edInitPy(True)
   proc.edAddChild(CAS_node)
 
   # Step 0.5: Find if there is a user init node