From: André Ribes Date: Thu, 24 Mar 2011 20:36:46 +0000 (+0100) Subject: Mode Debug OK X-Git-Tag: V6_4_0rc3~59 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a13f8485396ec32b7fab31ed7444e1a81e4ab71e;p=modules%2Fadao.git Mode Debug OK Il faudra faire plus --- diff --git a/resources/ADAOSchemaCatalog.xml b/resources/ADAOSchemaCatalog.xml index 703ee5c..823c011 100644 --- a/resources/ADAOSchemaCatalog.xml +++ b/resources/ADAOSchemaCatalog.xml @@ -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 + diff --git a/src/daEficas/generator_adao.py b/src/daEficas/generator_adao.py index 0a94146..6146f62 100644 --- a/src/daEficas/generator_adao.py +++ b/src/daEficas/generator_adao.py @@ -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" diff --git a/src/daSalome/daYacsIntegration/daOptimizerLoop.py b/src/daSalome/daYacsIntegration/daOptimizerLoop.py index 9e86cd8..1ea9a60 100644 --- a/src/daSalome/daYacsIntegration/daOptimizerLoop.py +++ b/src/daSalome/daYacsIntegration/daOptimizerLoop.py @@ -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() diff --git a/src/daSalome/daYacsIntegration/daStudy.py b/src/daSalome/daYacsIntegration/daStudy.py index ed685c0..bc63073 100644 --- a/src/daSalome/daYacsIntegration/daStudy.py +++ b/src/daSalome/daYacsIntegration/daStudy.py @@ -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 = {} diff --git a/src/daSalome/daYacsSchemaCreator/methods.py b/src/daSalome/daYacsSchemaCreator/methods.py index b31b691..d9922b1 100644 --- a/src/daSalome/daYacsSchemaCreator/methods.py +++ b/src/daSalome/daYacsSchemaCreator/methods.py @@ -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