Salome HOME
Minor corrections and change in example version level
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Fri, 9 Feb 2018 10:24:08 +0000 (11:24 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 11 Feb 2018 16:40:56 +0000 (17:40 +0100)
examples/daSkeletons/External_data_definition_by_scripts/ADAO_Case.comm.in
examples/daSkeletons/External_data_definition_by_scripts/ADAO_Case.py.in [new file with mode: 0644]
src/daComposant/daCore/Aidsm.py
src/daComposant/daCore/PlatformInfo.py
src/daSalome/daYacsIntegration/daStudy.py

index f4cf10fb26744ae7d014e81938b4661de7d5eb66..0cb2e122807241ab70f1fbf760b3aa54b5c206f1 100644 (file)
@@ -1,8 +1,10 @@
 
-ASSIMILATION_STUDY(Study_name='ADAO skeleton case',
-                   Study_repertory='@prefix@/share/salome/adao_examples/daSkeletons/External_data_definition_by_scripts',
-                   Debug=0,
-                   Algorithm='3DVAR',
+ASSIMILATION_STUDY(StudyName='ADAO skeleton case',
+                   StudyRepertory='@prefix@/share/salome/adao_examples/daSkeletons/External_data_definition_by_scripts',
+                   AlgorithmParameters=_F(Algorithm='3DVAR',
+                                       Parameters='Dict',
+                                       data=_F(FROM='Script',
+                                               SCRIPT_FILE='Script_AlgorithmParameters.py',),),
                    Background=_F(Stored=1,
                                  INPUT_TYPE='Vector',
                                  data=_F(FROM='Script',
@@ -23,8 +25,7 @@ ASSIMILATION_STUDY(Study_name='ADAO skeleton case',
                                           INPUT_TYPE='Function',
                                           data=_F(FROM='FunctionDict',
                                                   FUNCTIONDICT_FILE='Script_ObservationOperator_H.py',),),
-                   AlgorithmParameters=_F(INPUT_TYPE='Dict',
-                                          data=_F(FROM='Script',
-                                                  SCRIPT_FILE='Script_AlgorithmParameters.py',),),
                    UserPostAnalysis=_F(FROM='Script',
                                        SCRIPT_FILE='Script_UserPostAnalysis.py',),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
+
diff --git a/examples/daSkeletons/External_data_definition_by_scripts/ADAO_Case.py.in b/examples/daSkeletons/External_data_definition_by_scripts/ADAO_Case.py.in
new file mode 100644 (file)
index 0000000..223111b
--- /dev/null
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+study_config = {}
+study_config['StudyType'] = 'ASSIMILATION_STUDY'
+study_config['Name'] = 'ADAO skeleton case'
+study_config['Debug'] = '0'
+study_config['Algorithm'] = '3DVAR'
+AlgorithmParameters_config = {}
+AlgorithmParameters_config['Type'] = 'Dict'
+AlgorithmParameters_config['From'] = 'Script'
+AlgorithmParameters_config['Data'] = 'Script_AlgorithmParameters.py'
+study_config['AlgorithmParameters'] = AlgorithmParameters_config
+Background_config = {}
+Background_config['Type'] = 'Vector'
+Background_config['From'] = 'Script'
+Background_config['Data'] = 'Script_Background_xb.py'
+Background_config['Stored'] = '1'
+study_config['Background'] = Background_config
+BackgroundError_config = {}
+BackgroundError_config['Type'] = 'Matrix'
+BackgroundError_config['From'] = 'Script'
+BackgroundError_config['Data'] = 'Script_BackgroundError_B.py'
+BackgroundError_config['Stored'] = '0'
+study_config['BackgroundError'] = BackgroundError_config
+Observation_config = {}
+Observation_config['Type'] = 'Vector'
+Observation_config['From'] = 'Script'
+Observation_config['Data'] = 'Script_Observation_yo.py'
+Observation_config['Stored'] = '1'
+study_config['Observation'] = Observation_config
+ObservationError_config = {}
+ObservationError_config['Type'] = 'Matrix'
+ObservationError_config['From'] = 'Script'
+ObservationError_config['Data'] = 'Script_ObservationError_R.py'
+ObservationError_config['Stored'] = '0'
+study_config['ObservationError'] = ObservationError_config
+ObservationOperator_FunctionDict = {}
+ObservationOperator_FunctionDict['Function'] = ['Direct', 'Tangent', 'Adjoint']
+ObservationOperator_FunctionDict['Script'] = {}
+ObservationOperator_FunctionDict['Script']['Direct'] = 'Script_ObservationOperator_H.py'
+ObservationOperator_FunctionDict['Script']['Tangent'] = 'Script_ObservationOperator_H.py'
+ObservationOperator_FunctionDict['Script']['Adjoint'] = 'Script_ObservationOperator_H.py'
+ObservationOperator_config = {}
+ObservationOperator_config['Type'] = 'Function'
+ObservationOperator_config['From'] = 'FunctionDict'
+ObservationOperator_config['Data'] = ObservationOperator_FunctionDict
+study_config['ObservationOperator'] = ObservationOperator_config
+inputvariables_config = {}
+inputvariables_config['Order'] =['adao_default']
+inputvariables_config['adao_default'] = -1
+study_config['InputVariables'] = inputvariables_config
+outputvariables_config = {}
+outputvariables_config['Order'] = ['adao_default']
+outputvariables_config['adao_default'] = -1
+study_config['OutputVariables'] = outputvariables_config
+study_config['Repertory'] = '@prefix@/share/salome/adao_examples/daSkeletons/External_data_definition_by_scripts'
+Analysis_config = {}
+Analysis_config['From'] = 'Script'
+Analysis_config['Data'] = 'Script_UserPostAnalysis.py'
+study_config['UserPostAnalysis'] = Analysis_config
index 15cbb8366957baf23f84ad4fe3a5930e21a10048..5fcbbc177049a9436cb95d919ec913069df6561a 100644 (file)
@@ -42,6 +42,7 @@ class Aidsm(object):
     """ ADAO Internal Data Structure Model """
     def __init__(self, name = "", addViewers=None):
         self.__name = str(name)
+        self.__directory    = None
         self.__case = CaseLogger(self.__name, "case", addViewers)
         #
         self.__adaoObject   = {}
@@ -137,10 +138,10 @@ class Aidsm(object):
         except Exception as e:
             if isinstance(e, SyntaxError): msg = "at %s: %s"%(e.offset, e.text)
             else: msg = ""
-            raise ValueError("during settings, the following error occurs:\n"+\
-                             "\n%s %s\n\nSee also the potential messages, "+\
-                             "which can show the origin of the above error, "+\
-                             "in the launching terminal."%(str(e),msg))
+            raise ValueError(("during settings, the following error occurs:\n"+\
+                              "\n%s %s\n\nSee also the potential messages, "+\
+                              "which can show the origin of the above error, "+\
+                              "in the launching terminal.")%(str(e),msg))
 
     # -----------------------------------------------------------
 
@@ -224,29 +225,7 @@ class Aidsm(object):
             name               = Concept,
             asVector           = Vector,
             asPersistentVector = VectorSerie,
-            asScript           = Script,
-            scheduledBy        = Scheduler,
-            toBeChecked        = Checked,
-            )
-        if Stored:
-            self.__StoredInputs[Concept] = self.__adaoObject[Concept].getO()
-        return 0
-
-    def setControls(self,
-            Vector         = (), # Valeur par defaut pour un vecteur vide
-            VectorSerie    = None,
-            Script         = None,
-            Stored         = False,
-            Scheduler      = None,
-            Checked        = False):
-        "Definition d'un concept de calcul"
-        Concept = "Controls"
-        self.__case.register("set"+Concept, dir(), locals())
-        self.__adaoObject[Concept] = State(
-            name               = Concept,
-            asVector           = Vector,
-            asPersistentVector = VectorSerie,
-            asScript           = Script,
+            asScript           = self.with_directory(Script),
             scheduledBy        = Scheduler,
             toBeChecked        = Checked,
             )
@@ -413,12 +392,12 @@ class Aidsm(object):
             self.__StoredInputs[Concept] = self.__adaoObject[Concept].getO()
         return 0
 
-    def setDebug(self, level = 10):
+    def setDebug(self, __level = 10):
         "NOTSET=0 < DEBUG=10 < INFO=20 < WARNING=30 < ERROR=40 < CRITICAL=50"
         self.__case.register("setDebug",dir(),locals())
         log = logging.getLogger()
-        log.setLevel( level )
-        self.__StoredInputs["Debug"]   = level
+        log.setLevel( __level )
+        self.__StoredInputs["Debug"]   = __level
         self.__StoredInputs["NoDebug"] = False
         return 0
 
@@ -579,7 +558,6 @@ class Aidsm(object):
         files.sort()
         return files
 
-    # -----------------------------------------------------------
 
     def get_algorithms_main_path(self):
         """
index f401ab799c756bfd61f9989f55b93e010dafa82b..61927537bdede286498cc7ff436c821ca0b3922a 100644 (file)
@@ -186,6 +186,7 @@ except ImportError:
 has_salome = bool( "ROOT_SALOME"   in os.environ )
 has_yacs   = bool( "YACS_ROOT_DIR" in os.environ )
 has_adao   = bool( "ADAO_ROOT_DIR" in os.environ )
+has_eficas = bool( "EFICAS_ROOT_DIR" in os.environ )
 
 # ==============================================================================
 def uniq(sequence):
index 8993a988b563d2531f05dc8b0697dae444f5c1ee..730952bb9ad4e7e0b5742336e54cd02fcb2dc919 100644 (file)
@@ -37,7 +37,6 @@ class daStudy:
   def __init__(self, name, algorithm, debug):
 
     self.ADD = AssimilationStudy(name)
-    self.ADD.setControls()
     self.algorithm = algorithm
     self.algorithm_dict = None
     self.Background = None