Salome HOME
Update internal settings
[modules/adao.git] / resources / ADAOSchemaCatalog.xml
index 59b199c78526742c1e84952fc4ef1885827e6b75..62f434006d37902a75c0c35f82741949a8309dbf 100644 (file)
@@ -1,6 +1,8 @@
-<?xml version='1.0' encoding='iso-8859-1' ?>
+<?xml version='1.0' encoding='utf-8' ?>
 <!--
-  Copyright (C) 2010-2012 EDF R&D
+  Copyright (C) 2008-2019 EDF R&D
+
+  This file is part of SALOME ADAO module
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -17,7 +19,7 @@
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 
   See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-  
+
   Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
 -->
 <proc>
     <script><code>
 
 <![CDATA[
-import numpy, logging
-logging.debug("CREATE Entering in CreateAssimilationStudy")
-print "Entering in the assimilation study"
-print "Name is set to........:", Name
-print "Algorithm is set to...:", Algorithm
-print "Debug is set to.......:", Debug
-
-# Create Assimilation study
-from daYacsIntegration.daStudy import *
-assim_study = daStudy(Name, Algorithm, Debug)
-
-# Algorithm parameters
-try:
-  AlgorithmParameters
-except NameError:
-  pass
-else:
-  assim_study.setAlgorithmParameters(AlgorithmParameters)
+import sys, numpy, logging
+logging.debug("CREATE YI Entering in CreateAssimilationStudy")
+print("Entering in the assimilation study")
+print("Name is set to........:", Name)
+print("Algorithm is set to...:", Algorithm)
 
-logging.debug("CREATE Data entered are:")
-
-# Background
-try:
-  Background
-except NameError:
-  pass
-else:
-  logging.debug("CREATE Background is set")
-  logging.debug("CREATE BackgroundType is %s"%BackgroundType)
-  logging.debug("CREATE BackgroundStored is %s"%BackgroundStored)
-  assim_study.setBackgroundType(BackgroundType)
-  assim_study.setBackgroundStored(BackgroundStored)
-  assim_study.setBackground(Background)
-
-# CheckingPoint
-try:
-  CheckingPoint
-except NameError:
-  pass
-else:
-  logging.debug("CREATE CheckingPoint is set")
-  logging.debug("CREATE CheckingPointType is %s"%CheckingPointType)
-  logging.debug("CREATE CheckingPointStored is %s"%CheckingPointStored)
-  assim_study.setCheckingPointType(CheckingPointType)
-  assim_study.setCheckingPointStored(CheckingPointStored)
-  assim_study.setCheckingPoint(CheckingPoint)
-
-# BackgroundError
 try:
-  BackgroundError
-except NameError:
-  pass
-else:
-  logging.debug("CREATE BackgroundError is set")
-  logging.debug("CREATE BackgroundErrorStored is %s"%BackgroundErrorStored)
-  assim_study.setBackgroundErrorStored(BackgroundErrorStored)
-  assim_study.setBackgroundError(BackgroundError)
+    # Create Assimilation study
+    if sys.version_info.major > 2: import adao
+    from daYacsIntegration.daStudy import *
+    assim_study = daStudy(Name, Algorithm, Debug)
+
+    logging.debug("CREATE YI Data entered are:")
+
+    # Algorithm parameters
+    if "AlgorithmParameters" in locals():
+      logging.debug("CREATE YI AlgorithmParameters is %s"%AlgorithmParameters)
+      assim_study.setYIAlgorithmParameters(AlgorithmParameters)
+
+    # Background
+    if "Background" in locals():
+      logging.debug("CREATE YI Background is set")
+      logging.debug("CREATE YI BackgroundType is %s"%BackgroundType)
+      logging.debug("CREATE YI BackgroundStored is %s"%BackgroundStored)
+      assim_study.setYIBackgroundType(BackgroundType)
+      assim_study.setYIBackgroundStored(BackgroundStored)
+      assim_study.setYIBackground(Background)
+
+    # CheckingPoint
+    if "CheckingPoint" in locals():
+      logging.debug("CREATE YI CheckingPoint is set")
+      logging.debug("CREATE YI CheckingPointType is %s"%CheckingPointType)
+      logging.debug("CREATE YI CheckingPointStored is %s"%CheckingPointStored)
+      assim_study.setYICheckingPointType(CheckingPointType)
+      assim_study.setYICheckingPointStored(CheckingPointStored)
+      assim_study.setYICheckingPoint(CheckingPoint)
+
+    # ControlInput
+    if "ControlInput" in locals():
+      logging.debug("CREATE YI ControlInput is set")
+      logging.debug("CREATE YI ControlInputType is %s"%ControlInputType)
+      logging.debug("CREATE YI ControlInputStored is %s"%ControlInputStored)
+      assim_study.setYIControlInputType(ControlInputType)
+      assim_study.setYIControlInputStored(ControlInputStored)
+      assim_study.setYIControlInput(ControlInput)
+
+    # Observation
+    if "Observation" in locals():
+      logging.debug("CREATE YI Observation is set")
+      logging.debug("CREATE YI ObservationType is %s"%ObservationType)
+      logging.debug("CREATE YI ObservationStored is %s"%ObservationStored)
+      assim_study.setYIObservationType(ObservationType)
+      assim_study.setYIObservationStored(ObservationStored)
+      assim_study.setYIObservation(Observation)
+
+    # BackgroundError
+    if "BackgroundError" in locals():
+      logging.debug("CREATE YI BackgroundError is set")
+      logging.debug("CREATE YI BackgroundErrorType is %s"%BackgroundErrorType)
+      logging.debug("CREATE YI BackgroundErrorStored is %s"%BackgroundErrorStored)
+      assim_study.setYIBackgroundErrorType(BackgroundErrorType)
+      assim_study.setYIBackgroundErrorStored(BackgroundErrorStored)
+      assim_study.setYIBackgroundError(BackgroundError)
+
+    # ObservationError
+    if "ObservationError" in locals():
+      logging.debug("CREATE YI ObservationError is set")
+      logging.debug("CREATE YI ObservationErrorType is %s"%ObservationErrorType)
+      logging.debug("CREATE YI ObservationErrorStored is %s"%ObservationErrorStored)
+      assim_study.setYIObservationErrorType(ObservationErrorType)
+      assim_study.setYIObservationErrorStored(ObservationErrorStored)
+      assim_study.setYIObservationError(ObservationError)
+
+    # EvolutionError
+    if "EvolutionError" in locals():
+      logging.debug("CREATE YI EvolutionError is set")
+      logging.debug("CREATE YI EvolutionErrorType is %s"%EvolutionErrorType)
+      logging.debug("CREATE YI EvolutionErrorStored is %s"%EvolutionErrorStored)
+      assim_study.setYIEvolutionErrorType(EvolutionErrorType)
+      assim_study.setYIEvolutionErrorStored(EvolutionErrorStored)
+      assim_study.setYIEvolutionError(EvolutionError)
+
+    # ObservationOperator
+    ObservationOperatorOk = 0
+    if "ObservationOperator" in locals():
+      logging.debug("CREATE YI ObservationOperator is set")
+      logging.debug("CREATE YI ObservationOperatorType is %s"%ObservationOperatorType)
+      assim_study.setYIObservationOperatorType("Matrix", ObservationOperatorType)
+      assim_study.setYIObservationOperator("Matrix", ObservationOperator)
+      ObservationOperatorOk = 1
+
+    if ObservationOperatorOk == 0:
+      if "ObservationOperatorDirect" in locals():
+        logging.debug("CREATE YI ObservationOperatorDirect is %s"%ObservationOperatorDirect)
+        assim_study.setYIObservationOperatorType("Direct", "Function")
+        assim_study.setYIObservationOperator("Direct", ObservationOperatorDirect)
+      if "ObservationOperatorTangent" in locals():
+        logging.debug("CREATE YI ObservationOperatorTangent is %s"%ObservationOperatorTangent)
+        assim_study.setYIObservationOperatorType("Tangent", "Function")
+        assim_study.setYIObservationOperator("Tangent", ObservationOperatorTangent)
+      if "ObservationOperatorAdjoint" in locals():
+        logging.debug("CREATE YI ObservationOperatorAdjoint is %s"%ObservationOperatorAdjoint)
+        assim_study.setYIObservationOperatorType("Adjoint", "Function")
+        assim_study.setYIObservationOperator("Adjoint", ObservationOperatorAdjoint)
+
+    # EvolutionModel
+    EvolutionModelOk = 0
+    if "EvolutionModel" in locals():
+      logging.debug("CREATE YI EvolutionModel is set")
+      logging.debug("CREATE YI EvolutionModelType is %s"%EvolutionModelType)
+      assim_study.setYIEvolutionModelType("Matrix", EvolutionModelType)
+      assim_study.setYIEvolutionModel("Matrix", EvolutionModel)
+      EvolutionModelOk = 1
+
+    if EvolutionModelOk == 0:
+      if "EvolutionModelDirect" in locals():
+        logging.debug("CREATE YI EvolutionModelDirect is %s"%EvolutionModelDirect)
+        assim_study.setYIEvolutionModelType("Direct", "Function")
+        assim_study.setYIEvolutionModel("Direct", EvolutionModelDirect)
+      if "EvolutionModelTangent" in locals():
+        logging.debug("CREATE YI EvolutionModelTangent is %s"%EvolutionModelTangent)
+        assim_study.setYIEvolutionModelType("Tangent", "Function")
+        assim_study.setYIEvolutionModel("Tangent", EvolutionModelTangent)
+      if "EvolutionModelAdjoint" in locals():
+        logging.debug("CREATE YI EvolutionModelAdjoint is %s"%EvolutionModelAdjoint)
+        assim_study.setYIEvolutionModelType("Adjoint", "Function")
+        assim_study.setYIEvolutionModel("Adjoint", EvolutionModelAdjoint)
+
+    # Variables
+    for name, size in zip(InputVariablesNames, InputVariablesSizes):
+      assim_study.setYIInputVariable(name, size)
+    for name, size in zip(OutputVariablesNames, OutputVariablesSizes):
+      assim_study.setYIOutputVariable(name, size)
+
+    if has_observers:
+      logging.debug("CREATE YI Observers keys are %s"%observers.keys())
+      # Adding observers to the study
+      for observer_name in observers.keys():
+        scheduler = ""
+        info = ""
+        number = str(observers[observer_name]["number"])
+        if "scheduler" in observers[observer_name].keys():
+          scheduler = observers[observer_name]["scheduler"]
+        if "info" in observers[observer_name].keys():
+          info = observers[observer_name]["info"]
+        assim_study.addYIObserver(observer_name, scheduler, info, number)
+
+except Exception as e:
+    if isinstance(e, SyntaxError): msg = "at %s: %s"%(e.offset, e.text)
+    else: msg = ""
+    raise ValueError("during execution, 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))
 
-# Observation
-try:
-  Observation
-except NameError:
-  pass
-else:
-  logging.debug("CREATE Observation is set")
-  logging.debug("CREATE ObservationType is %s"%ObservationType)
-  logging.debug("CREATE ObservationStored is %s"%ObservationStored)
-  assim_study.setObservationType(ObservationType)
-  assim_study.setObservationStored(ObservationStored)
-  assim_study.setObservation(Observation)
-
-# ObservationError
-try:
-  ObservationError
-except NameError:
-  pass
-else:
-  logging.debug("CREATE ObservationError is set")
-  logging.debug("CREATE ObservationErrorStored is %s"%ObservationErrorStored)
-  assim_study.setObservationErrorStored(ObservationErrorStored)
-  assim_study.setObservationError(ObservationError)
-
-# EvolutionError
-try:
-  EvolutionError
-except NameError:
-  pass
-else:
-  logging.debug("CREATE EvolutionError is set")
-  logging.debug("CREATE EvolutionErrorStored is %s"%EvolutionErrorStored)
-  assim_study.setEvolutionErrorStored(EvolutionErrorStored)
-  assim_study.setEvolutionError(EvolutionError)
-
-# ObservationOperator
-ObservationOperatorOk = 0
-try:
-  ObservationOperator
-except NameError:
-  pass
-else:
-  logging.debug("CREATE ObservationOperator is set")
-  logging.debug("CREATE ObservationOperatorType is %s"%ObservationOperatorType)
-  assim_study.setObservationOperatorType("Matrix", ObservationOperatorType)
-  assim_study.setObservationOperator("Matrix", ObservationOperator)
-  ObservationOperatorOk = 1
-
-if ObservationOperatorOk == 0:
-  try:
-    ObservationOperatorDirect
-  except NameError:
-    pass
-  else:
-    logging.debug("CREATE ObservationOperatorDirect is %s"%ObservationOperatorDirect)
-    assim_study.setObservationOperatorType("Direct", "Function")
-    assim_study.setObservationOperator("Direct", ObservationOperatorDirect)
-  try:
-    ObservationOperatorTangent
-  except NameError:
-    pass
-  else:
-    logging.debug("CREATE ObservationOperatorTangent is %s"%ObservationOperatorTangent)
-    assim_study.setObservationOperatorType("Tangent", "Function")
-    assim_study.setObservationOperator("Tangent", ObservationOperatorTangent)
-  try:
-    ObservationOperatorAdjoint
-  except NameError:
-    pass
-  else:
-    logging.debug("CREATE ObservationOperatorAdjoint is %s"%ObservationOperatorAdjoint)
-    assim_study.setObservationOperatorType("Adjoint", "Function")
-    assim_study.setObservationOperator("Adjoint", ObservationOperatorAdjoint)
-
-# EvolutionModel
-EvolutionModelOk = 0
-try:
-  EvolutionModel
-except NameError:
-  pass
-else:
-  logging.debug("CREATE EvolutionModel is set")
-  logging.debug("CREATE EvolutionModelType is %s"%EvolutionModelType)
-  assim_study.setEvolutionModelType("Matrix", EvolutionModelType)
-  assim_study.setEvolutionModel("Matrix", EvolutionModel)
-  EvolutionModelOk = 1
-
-if EvolutionModelOk == 0:
-  try:
-    EvolutionModelDirect
-  except NameError:
-    pass
-  else:
-    logging.debug("CREATE EvolutionModelDirect is %s"%EvolutionModelDirect)
-    assim_study.setEvolutionModelType("Direct", "Function")
-    assim_study.setEvolutionModel("Direct", EvolutionModelDirect)
-  try:
-    EvolutionModelTangent
-  except NameError:
-    pass
-  else:
-    logging.debug("CREATE EvolutionModelTangent is %s"%EvolutionModelTangent)
-    assim_study.setEvolutionModelType("Tangent", "Function")
-    assim_study.setEvolutionModel("Tangent", EvolutionModelTangent)
-  try:
-    EvolutionModelAdjoint
-  except NameError:
-    pass
-  else:
-    logging.debug("CREATE EvolutionModelAdjoint is %s"%EvolutionModelAdjoint)
-    assim_study.setEvolutionModelType("Adjoint", "Function")
-    assim_study.setEvolutionModel("Adjoint", EvolutionModelAdjoint)
-
-# Variables
-for name, size in zip(InputVariablesNames, InputVariablesSizes):
-  assim_study.setInputVariable(name, size)
-for name, size in zip(OutputVariablesNames, OutputVariablesSizes):
-  assim_study.setOutputVariable(name, size)
-
-if has_observers:
-  logging.debug("CREATE Observers keys are %s"%observers.keys())
-  # Adding observers to the study
-  for observer_name in observers.keys():
-    scheduler = ""
-    info = ""
-    number = str(observers[observer_name]["number"])
-    if "scheduler" in observers[observer_name].keys():
-      scheduler = observers[observer_name]["scheduler"]
-    if "info" in observers[observer_name].keys():
-      info = observers[observer_name]["info"]
-    assim_study.addObserver(observer_name, scheduler, info, number)
 Study = assim_study
 ]]>
 
@@ -265,10 +230,59 @@ Study = assim_study
   <inline name="CreateNumpyMatrixFromString">
     <script><code><![CDATA[
 import numpy, logging
-logging.debug("CREATE Entering in CreateNumpyMatrixFromString")
-matrix = numpy.matrix(matrix_in_string)
+logging.debug("CREATE YI Entering in CreateNumpyMatrixFromString")
+if (matrix_in_string.find("array")>-1) or (matrix_in_string.find("matrix")>-1):
+    matrix_in_string=matrix_in_string.replace("array","numpy.array")
+    matrix_in_string=matrix_in_string.replace("matrix","numpy.matrix")
+    exec("matrix="+matrix_in_string)
+    matrix = numpy.matrix(matrix)
+else:
+    matrix_in_string=matrix_in_string.replace("'","").replace('"','')
+    matrix = numpy.matrix(matrix_in_string)
 type = "Matrix"
-logging.debug("CREATE Matrix is %s"%matrix)
+logging.debug("CREATE YI Matrix is %s"%matrix)
+]]></code></script>
+    <inport name="matrix_in_string" type="string"/>
+    <outport name="matrix" type="pyobj"/>
+    <outport name="type" type="string"/>
+    <outport name="stored" type="bool"/>
+  </inline>
+
+  <inline name="CreateNumpyScalarSparseMatrixFromString">
+    <script><code><![CDATA[
+import numpy, logging
+logging.debug("CREATE YI Entering in CreateNumpyScalarSparseMatrixFromString")
+if (matrix_in_string.find("array")>-1) or (matrix_in_string.find("matrix")>-1):
+    matrix_in_string=matrix_in_string.replace("array","numpy.array")
+    matrix_in_string=matrix_in_string.replace("matrix","numpy.matrix")
+    exec("matrix="+matrix_in_string)
+    matrix = numpy.matrix(matrix)
+else:
+    matrix_in_string=matrix_in_string.replace("'","").replace('"','')
+    matrix = numpy.matrix(matrix_in_string)
+type = "ScalarSparseMatrix"
+logging.debug("CREATE YI ScalarSparseMatrix is %s"%matrix)
+]]></code></script>
+    <inport name="matrix_in_string" type="string"/>
+    <outport name="matrix" type="pyobj"/>
+    <outport name="type" type="string"/>
+    <outport name="stored" type="bool"/>
+  </inline>
+
+  <inline name="CreateNumpyDiagonalSparseMatrixFromString">
+    <script><code><![CDATA[
+import numpy, logging
+logging.debug("CREATE YI Entering in CreateNumpyDiagonalSparseMatrixFromString")
+if (matrix_in_string.find("array")>-1) or (matrix_in_string.find("matrix")>-1):
+    matrix_in_string=matrix_in_string.replace("array","numpy.array")
+    matrix_in_string=matrix_in_string.replace("matrix","numpy.matrix")
+    exec("matrix="+matrix_in_string)
+    matrix = numpy.matrix(matrix)
+else:
+    matrix_in_string=matrix_in_string.replace("'","").replace('"','')
+    matrix = numpy.matrix(matrix_in_string)
+type = "DiagonalSparseMatrix"
+logging.debug("CREATE YI DiagonalSparseMatrix is %s"%matrix)
 ]]></code></script>
     <inport name="matrix_in_string" type="string"/>
     <outport name="matrix" type="pyobj"/>
@@ -278,24 +292,70 @@ logging.debug("CREATE Matrix is %s"%matrix)
 
   <inline name="CreateNumpyMatrixFromScript">
     <script><code><![CDATA[
-import logging
-logging.debug("CREATE Entering in CreateNumpyMatrixFromScript")
+import logging, sys, os
+logging.debug("CREATE YI Entering in CreateNumpyMatrixFromScript")
 type = "Matrix"
 
 # Get file path and filename
-import sys
-import os
+try:
+    if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+        sys.path.insert(0,studydir)
+except:
+    pass
+filepath = os.path.dirname(script)
+filename = os.path.basename(script)
+module_name = os.path.splitext(filename)[0]
+if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
+    sys.path.insert(0,filepath)
+
+]]></code></script>
+    <inport name="script" type="string"/>
+    <outport name="type" type="string"/>
+    <outport name="stored" type="bool"/>
+  </inline>
+
+  <inline name="CreateNumpyScalarSparseMatrixFromScript">
+    <script><code><![CDATA[
+import logging, sys, os
+logging.debug("CREATE YI Entering in CreateNumpyScalarSparseMatrixFromScript")
+type = "ScalarSparseMatrix"
+
+# Get file path and filename
+try:
+    if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+        sys.path.insert(0,studydir)
+except:
+    pass
 filepath = os.path.dirname(script)
 filename = os.path.basename(script)
 module_name = os.path.splitext(filename)[0]
 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
     sys.path.insert(0,filepath)
 
-# Import script
-__import__(module_name)
-user_script_module = sys.modules[module_name]
+]]></code></script>
+    <inport name="script" type="string"/>
+    <outport name="type" type="string"/>
+    <outport name="stored" type="bool"/>
+  </inline>
+
+  <inline name="CreateNumpyDiagonalSparseMatrixFromScript">
+    <script><code><![CDATA[
+import logging, sys, os
+logging.debug("CREATE YI Entering in CreateNumpyDiagonalSparseMatrixFromScript")
+type = "DiagonalSparseMatrix"
+
+# Get file path and filename
+try:
+    if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+        sys.path.insert(0,studydir)
+except:
+    pass
+filepath = os.path.dirname(script)
+filename = os.path.basename(script)
+module_name = os.path.splitext(filename)[0]
+if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
+    sys.path.insert(0,filepath)
 
-# Get Data from script
 ]]></code></script>
     <inport name="script" type="string"/>
     <outport name="type" type="string"/>
@@ -305,8 +365,15 @@ user_script_module = sys.modules[module_name]
   <inline name="CreateNumpyVectorFromString">
     <script><code><![CDATA[
 import numpy, logging
-logging.debug("CREATE Entering in CreateNumpyVectorFromString")
-vector = numpy.matrix(vector_in_string)
+logging.debug("CREATE YI Entering in CreateNumpyVectorFromString")
+if (vector_in_string.find("array")>-1) or (vector_in_string.find("matrix")>-1):
+    vector_in_string=vector_in_string.replace("array","numpy.array")
+    vector_in_string=vector_in_string.replace("matrix","numpy.matrix")
+    exec("vector="+vector_in_string)
+    vector = numpy.matrix(vector)
+else:
+    vector_in_string=vector_in_string.replace("'","").replace('"','')
+    vector = numpy.matrix(vector_in_string)
 type = "Vector"
 logging.debug("Vector is %s"%vector)
 ]]></code></script>
@@ -318,24 +385,22 @@ logging.debug("Vector is %s"%vector)
 
   <inline name="CreateNumpyVectorFromScript">
     <script><code><![CDATA[
-import logging
-logging.debug("CREATE Entering in CreateNumpyVectorFromScript")
+import logging, sys, os
+logging.debug("CREATE YI Entering in CreateNumpyVectorFromScript")
 type = "Vector"
 
 # Get file path and filename
-import sys
-import os
+try:
+    if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+        sys.path.insert(0,studydir)
+except:
+    pass
 filepath = os.path.dirname(script)
 filename = os.path.basename(script)
 module_name = os.path.splitext(filename)[0]
 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
     sys.path.insert(0,filepath)
 
-# Import script
-__import__(module_name)
-user_script_module = sys.modules[module_name]
-
-# Get Data from script
 ]]></code></script>
     <inport name="script" type="string"/>
     <outport name="type" type="string"/>
@@ -345,8 +410,9 @@ user_script_module = sys.modules[module_name]
   <inline name="CreateNumpyVectorSerieFromString">
     <script><code><![CDATA[
 import numpy, logging
-logging.debug("CREATE Entering in CreateNumpyVectorSerieFromString")
-vector = numpy.matrix(vector_in_string)
+logging.debug("CREATE YI Entering in CreateNumpyVectorSerieFromString")
+vector_in_list = eval(str(vector_in_string),{},{})
+vector = numpy.matrix(vector_in_list)
 type = "VectorSerie"
 logging.debug("VectorSerie is %s"%vector)
 ]]></code></script>
@@ -358,24 +424,22 @@ logging.debug("VectorSerie is %s"%vector)
 
   <inline name="CreateNumpyVectorSerieFromScript">
     <script><code><![CDATA[
-import logging
-logging.debug("CREATE Entering in CreateNumpyVectorSerieFromScript")
+import logging, sys, os
+logging.debug("CREATE YI Entering in CreateNumpyVectorSerieFromScript")
 type = "VectorSerie"
 
 # Get file path and filename
-import sys
-import os
+try:
+    if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+        sys.path.insert(0,studydir)
+except:
+    pass
 filepath = os.path.dirname(script)
 filename = os.path.basename(script)
 module_name = os.path.splitext(filename)[0]
 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
     sys.path.insert(0,filepath)
 
-# Import script
-__import__(module_name)
-user_script_module = sys.modules[module_name]
-
-# Get Data from script
 ]]></code></script>
     <inport name="script" type="string"/>
     <outport name="type" type="string"/>
@@ -387,7 +451,7 @@ user_script_module = sys.modules[module_name]
 import logging
 logging.debug("EXECUTE Entering in SimpleExecuteDirectAlgorithm")
 from daYacsIntegration.daStudy import *
-ADD = Study.getAssimilationStudy()
+ADD = Study.getResults()
 ADD.analyze()
 ]]></code></script>
     <inport name="Study" type="pyobj"/>
@@ -396,11 +460,13 @@ ADD.analyze()
 
   <inline name="SimpleUserAnalysis">
     <script><code><![CDATA[
-#-*-coding:iso-8859-1-*-
-import logging
+#-*- coding: utf-8 -*-
+import sys, logging
 logging.debug("TERMINATE Entering in SimpleUserAnalysis")
-from daYacsIntegration.daStudy import *
-ADD = Study.getAssimilationStudy()
+if sys.version_info.major < 3:
+    ADD = Study.getResults()
+else:
+    ADD = Study
 # User code is below
 
 ]]></code></script>
@@ -417,62 +483,70 @@ result = None
     <outport name="result" type="SALOME_TYPES/ParametricOutput"/>
   </inline>
 
+  <inline name="CreateDictFromString">
+    <script><code><![CDATA[
+import logging, sys, os
+logging.debug("CREATE YI Entering in CreateDictFromString")
+dico = eval(dict_in_string)
+]]></code></script>
+    <inport name="dict_in_string" type="string"/>
+  </inline>
+
   <inline name="CreateDictFromScript">
     <script><code><![CDATA[
-import logging
-logging.debug("CREATE Entering in CreateDictFromScript")
+import logging, sys, os
+logging.debug("CREATE YI Entering in CreateDictFromScript")
 
 # Get file path and filename
-import sys
-import os
+try:
+    if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+        sys.path.insert(0,studydir)
+except:
+    pass
 filepath = os.path.dirname(script)
 filename = os.path.basename(script)
 module_name = os.path.splitext(filename)[0]
 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
     sys.path.insert(0,filepath)
 
-# Import script
-__import__(module_name)
-user_script_module = sys.modules[module_name]
-
-# Get Data from script
 ]]></code></script>
     <inport name="script" type="string"/>
   </inline>
 
   <inline name="UserDataInitFromScript">
     <script><code><![CDATA[
-import logging
-logging.debug("CREATE Entering in UserDataInitFromScript")
+import logging, sys, os
+logging.debug("CREATE YI Entering in UserDataInitFromScript")
 
 # Get file path and filename
-import sys
-import os
+try:
+    if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
+        sys.path.insert(0,studydir)
+except:
+    pass
 filepath = os.path.dirname(script)
 filename = os.path.basename(script)
 module_name = os.path.splitext(filename)[0]
 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
     sys.path.insert(0,filepath)
 
-# Import script
-__import__(module_name)
-user_script_module = sys.modules[module_name]
-
-# Get Data from script
 ]]></code></script>
     <inport name="script" type="string"/>
     <outport name="init_data" type="pyobj"/>
   </inline>
 
   <inline name="ReadForSwitchNode">
-    <script><code><![CDATA[
-import logging
-logging.debug("CREATE Entering in ReadForSwitchNode")
-logging.debug("       with input data : "+str(data["specificParameters"]))
+    <script><code><![CDATA[import sys, logging, codecs, pickle
+if sys.version_info.major > 2: import adao
+def loads( data ):
+  return pickle.loads(codecs.decode(data.encode(), "base64"))
+logging.debug("CREATE YI Entering in ReadForSwitchNode")
+# logging.debug("       with input data : ",list(data["specificParameters"]))
 switch_value = -1
 for param in data["specificParameters"]:
+  # logging.debug("       ReadForSwitchNode specificParameters : ",param)
   if param["name"] == "switch_value":
-    switch_value = int(param["value"])
+    switch_value = int(loads(param["value"]))
 logging.debug("       switching to value : "+str(switch_value))
 ]]></code></script>
     <inport name="data" type="SALOME_TYPES/ParametricInput"/>
@@ -481,18 +555,19 @@ logging.debug("       switching to value : "+str(switch_value))
   </inline>
 
   <inline name="ExtractDataNode">
-    <script><code><![CDATA[
-import logging
-logging.debug("TERMINATE Entering in ExtractDataNode")
-import cPickle
+    <script><code><![CDATA[import sys, logging, codecs, pickle
+if sys.version_info.major > 2: import adao
+def loads( data ):
+  return pickle.loads(codecs.decode(data.encode(), "base64"))
+logging.debug("TERMINATE Entering in ExtractData/Node")
 from daCore.AssimilationStudy import AssimilationStudy
 var = None
 info = None
 for param in data["specificParameters"]:
   if param["name"] == "var":
-    var = cPickle.loads(param["value"])
+    var = loads(param["value"])
   if param["name"] == "info":
-    info = param["value"]
+    info = loads(param["value"])
 ]]></code></script>
     <inport name="data" type="SALOME_TYPES/ParametricInput"/>
     <outport name="var" type="pyobj"/>
@@ -500,20 +575,13 @@ for param in data["specificParameters"]:
   </inline>
 
   <inline name="ObservationNodeString">
-    <script><code><![CDATA[
-#print "Entering in Observation"
-
-]]></code></script>
+    <script><code><![CDATA[]]></code></script>
     <inport name="var" type="pyobj"/>
     <inport name="info" type="pyobj"/>
   </inline>
 
   <inline name="ObservationNodeFile">
-    <script><code><![CDATA[
-#print "Entering in Observation"
-execfile(script)
-
-]]></code></script>
+    <script><code><![CDATA[with open(script, 'rb') as file: exec(file.read())]]></code></script>
     <inport name="var"    type="pyobj"/>
     <inport name="info"   type="pyobj"/>
     <inport name="script" type="string"/>
@@ -534,7 +602,7 @@ output["errorMessage"]        = ""
 
   <inline name="SetObserversNode">
     <script><code><![CDATA[
-#print "Setting observers"
+#print("Setting observers")
 ]]></code></script>
     <outport name="has_observers" type="bool"/>
     <outport name="observers" type="pyobj"/>