]> SALOME platform Git repositories - modules/adao.git/blob - resources/ADAOSchemaCatalog.xml
Salome HOME
Correction of Python 3 compatibility with YACS types
[modules/adao.git] / resources / ADAOSchemaCatalog.xml
1 <?xml version='1.0' encoding='utf-8' ?>
2 <!--
3   Copyright (C) 2008-2018 EDF R&D
4
5   This file is part of SALOME ADAO module
6
7   This library is free software; you can redistribute it and/or
8   modify it under the terms of the GNU Lesser General Public
9   License as published by the Free Software Foundation; either
10   version 2.1 of the License.
11
12   This library is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15   Lesser General Public License for more details.
16
17   You should have received a copy of the GNU Lesser General Public
18   License along with this library; if not, write to the Free Software
19   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
20
21   See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22
23   Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
24 -->
25 <proc>
26
27   <objref name="computeAD" id="python:computeAD:1.0">
28     <base>pyobj</base>
29   </objref>
30
31   <!-- Types for parametric computations -->
32   <!-- TODO On devrait pouvoir le lire depuis le KERNEL !!!-->
33   <type name="long" kind="int"/>
34   <struct name="SALOME_TYPES/Parameter">
35     <member type="string" name="name"></member>
36     <member type="pyobj" name="value"></member>
37   </struct>
38   <sequence content="SALOME_TYPES/Parameter" name="SALOME_TYPES/ParameterList"></sequence>
39   <sequence content="double" name="SALOME_TYPES/Variable"></sequence>
40   <sequence content="SALOME_TYPES/Variable" name="SALOME_TYPES/VariableSequence"></sequence>
41   <sequence content="SALOME_TYPES/VariableSequence" name="SALOME_TYPES/StateSequence"></sequence>
42   <sequence content="SALOME_TYPES/StateSequence" name="SALOME_TYPES/TimeSequence"></sequence>
43   <sequence content="string" name="SALOME_TYPES/VarList"></sequence>
44   <struct name="SALOME_TYPES/ParametricInput">
45     <member type="SALOME_TYPES/VarList" name="inputVarList"></member>
46     <member type="SALOME_TYPES/VarList" name="outputVarList"></member>
47     <member type="SALOME_TYPES/TimeSequence" name="inputValues"></member>
48     <member type="SALOME_TYPES/ParameterList" name="specificParameters"></member>
49   </struct>
50   <struct name="SALOME_TYPES/ParametricOutput">
51     <member type="SALOME_TYPES/TimeSequence" name="outputValues"></member>
52     <member type="SALOME_TYPES/ParameterList" name="specificOutputInfos"></member>
53     <member type="long" name="returnCode"></member>
54     <member type="string" name="errorMessage"></member>
55   </struct>
56
57
58   <inline name="CreateAssimilationStudy">
59     <script><code>
60
61 <![CDATA[
62 import sys, numpy, logging
63 logging.debug("CREATE YI Entering in CreateAssimilationStudy")
64 print("Entering in the assimilation study")
65 print("Name is set to........:", Name)
66 print("Algorithm is set to...:", Algorithm)
67
68 try:
69     # Create Assimilation study
70     if sys.version_info.major > 2:
71         import adao
72     from daYacsIntegration.daStudy import *
73     assim_study = daStudy(Name, Algorithm, Debug)
74
75     logging.debug("CREATE YI Data entered are:")
76
77     # Algorithm parameters
78     if "AlgorithmParameters" in locals():
79       logging.debug("CREATE YI AlgorithmParameters is %s"%AlgorithmParameters)
80       assim_study.setYIAlgorithmParameters(AlgorithmParameters)
81
82     # Background
83     if "Background" in locals():
84       logging.debug("CREATE YI Background is set")
85       logging.debug("CREATE YI BackgroundType is %s"%BackgroundType)
86       logging.debug("CREATE YI BackgroundStored is %s"%BackgroundStored)
87       assim_study.setYIBackgroundType(BackgroundType)
88       assim_study.setYIBackgroundStored(BackgroundStored)
89       assim_study.setYIBackground(Background)
90
91     # CheckingPoint
92     if "CheckingPoint" in locals():
93       logging.debug("CREATE YI CheckingPoint is set")
94       logging.debug("CREATE YI CheckingPointType is %s"%CheckingPointType)
95       logging.debug("CREATE YI CheckingPointStored is %s"%CheckingPointStored)
96       assim_study.setYICheckingPointType(CheckingPointType)
97       assim_study.setYICheckingPointStored(CheckingPointStored)
98       assim_study.setYICheckingPoint(CheckingPoint)
99
100     # ControlInput
101     if "ControlInput" in locals():
102       logging.debug("CREATE YI ControlInput is set")
103       logging.debug("CREATE YI ControlInputType is %s"%ControlInputType)
104       logging.debug("CREATE YI ControlInputStored is %s"%ControlInputStored)
105       assim_study.setYIControlInputType(ControlInputType)
106       assim_study.setYIControlInputStored(ControlInputStored)
107       assim_study.setYIControlInput(ControlInput)
108
109     # Observation
110     if "Observation" in locals():
111       logging.debug("CREATE YI Observation is set")
112       logging.debug("CREATE YI ObservationType is %s"%ObservationType)
113       logging.debug("CREATE YI ObservationStored is %s"%ObservationStored)
114       assim_study.setYIObservationType(ObservationType)
115       assim_study.setYIObservationStored(ObservationStored)
116       assim_study.setYIObservation(Observation)
117
118     # BackgroundError
119     if "BackgroundError" in locals():
120       logging.debug("CREATE YI BackgroundError is set")
121       logging.debug("CREATE YI BackgroundErrorType is %s"%BackgroundErrorType)
122       logging.debug("CREATE YI BackgroundErrorStored is %s"%BackgroundErrorStored)
123       assim_study.setYIBackgroundErrorType(BackgroundErrorType)
124       assim_study.setYIBackgroundErrorStored(BackgroundErrorStored)
125       assim_study.setYIBackgroundError(BackgroundError)
126
127     # ObservationError
128     if "ObservationError" in locals():
129       logging.debug("CREATE YI ObservationError is set")
130       logging.debug("CREATE YI ObservationErrorType is %s"%ObservationErrorType)
131       logging.debug("CREATE YI ObservationErrorStored is %s"%ObservationErrorStored)
132       assim_study.setYIObservationErrorType(ObservationErrorType)
133       assim_study.setYIObservationErrorStored(ObservationErrorStored)
134       assim_study.setYIObservationError(ObservationError)
135
136     # EvolutionError
137     if "EvolutionError" in locals():
138       logging.debug("CREATE YI EvolutionError is set")
139       logging.debug("CREATE YI EvolutionErrorType is %s"%EvolutionErrorType)
140       logging.debug("CREATE YI EvolutionErrorStored is %s"%EvolutionErrorStored)
141       assim_study.setYIEvolutionErrorType(EvolutionErrorType)
142       assim_study.setYIEvolutionErrorStored(EvolutionErrorStored)
143       assim_study.setYIEvolutionError(EvolutionError)
144
145     # ObservationOperator
146     ObservationOperatorOk = 0
147     if "ObservationOperator" in locals():
148       logging.debug("CREATE YI ObservationOperator is set")
149       logging.debug("CREATE YI ObservationOperatorType is %s"%ObservationOperatorType)
150       assim_study.setYIObservationOperatorType("Matrix", ObservationOperatorType)
151       assim_study.setYIObservationOperator("Matrix", ObservationOperator)
152       ObservationOperatorOk = 1
153
154     if ObservationOperatorOk == 0:
155       if "ObservationOperatorDirect" in locals():
156         logging.debug("CREATE YI ObservationOperatorDirect is %s"%ObservationOperatorDirect)
157         assim_study.setYIObservationOperatorType("Direct", "Function")
158         assim_study.setYIObservationOperator("Direct", ObservationOperatorDirect)
159       if "ObservationOperatorTangent" in locals():
160         logging.debug("CREATE YI ObservationOperatorTangent is %s"%ObservationOperatorTangent)
161         assim_study.setYIObservationOperatorType("Tangent", "Function")
162         assim_study.setYIObservationOperator("Tangent", ObservationOperatorTangent)
163       if "ObservationOperatorAdjoint" in locals():
164         logging.debug("CREATE YI ObservationOperatorAdjoint is %s"%ObservationOperatorAdjoint)
165         assim_study.setYIObservationOperatorType("Adjoint", "Function")
166         assim_study.setYIObservationOperator("Adjoint", ObservationOperatorAdjoint)
167
168     # EvolutionModel
169     EvolutionModelOk = 0
170     if "EvolutionModel" in locals():
171       logging.debug("CREATE YI EvolutionModel is set")
172       logging.debug("CREATE YI EvolutionModelType is %s"%EvolutionModelType)
173       assim_study.setYIEvolutionModelType("Matrix", EvolutionModelType)
174       assim_study.setYIEvolutionModel("Matrix", EvolutionModel)
175       EvolutionModelOk = 1
176
177     if EvolutionModelOk == 0:
178       if "EvolutionModelDirect" in locals():
179         logging.debug("CREATE YI EvolutionModelDirect is %s"%EvolutionModelDirect)
180         assim_study.setYIEvolutionModelType("Direct", "Function")
181         assim_study.setYIEvolutionModel("Direct", EvolutionModelDirect)
182       if "EvolutionModelTangent" in locals():
183         logging.debug("CREATE YI EvolutionModelTangent is %s"%EvolutionModelTangent)
184         assim_study.setYIEvolutionModelType("Tangent", "Function")
185         assim_study.setYIEvolutionModel("Tangent", EvolutionModelTangent)
186       if "EvolutionModelAdjoint" in locals():
187         logging.debug("CREATE YI EvolutionModelAdjoint is %s"%EvolutionModelAdjoint)
188         assim_study.setYIEvolutionModelType("Adjoint", "Function")
189         assim_study.setYIEvolutionModel("Adjoint", EvolutionModelAdjoint)
190
191     # Variables
192     for name, size in zip(InputVariablesNames, InputVariablesSizes):
193       assim_study.setYIInputVariable(name, size)
194     for name, size in zip(OutputVariablesNames, OutputVariablesSizes):
195       assim_study.setYIOutputVariable(name, size)
196
197     if has_observers:
198       logging.debug("CREATE YI Observers keys are %s"%observers.keys())
199       # Adding observers to the study
200       for observer_name in observers.keys():
201         scheduler = ""
202         info = ""
203         number = str(observers[observer_name]["number"])
204         if "scheduler" in observers[observer_name].keys():
205           scheduler = observers[observer_name]["scheduler"]
206         if "info" in observers[observer_name].keys():
207           info = observers[observer_name]["info"]
208         assim_study.addYIObserver(observer_name, scheduler, info, number)
209
210 except Exception as e:
211     if isinstance(e, SyntaxError): msg = "at %s: %s"%(e.offset, e.text)
212     else: msg = ""
213     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))
214
215 Study = assim_study
216 ]]>
217
218 </code></script>
219     <inport name="Name" type="string"/>
220     <inport name="Algorithm" type="string"/>
221     <inport name="Debug" type="bool"/>
222     <inport name="InputVariablesNames" type="stringvec"/>
223     <inport name="InputVariablesSizes" type="intvec"/>
224     <inport name="OutputVariablesNames" type="stringvec"/>
225     <inport name="OutputVariablesSizes" type="intvec"/>
226     <inport name="has_observers" type="bool"/>
227     <inport name="observers" type="pyobj"/>
228     <outport name="Study" type="pyobj"/>
229   </inline>
230
231   <inline name="CreateNumpyMatrixFromString">
232     <script><code><![CDATA[
233 import numpy, logging
234 logging.debug("CREATE YI Entering in CreateNumpyMatrixFromString")
235 if (matrix_in_string.find("array")>-1) or (matrix_in_string.find("matrix")>-1):
236     matrix_in_string=matrix_in_string.replace("array","numpy.array")
237     matrix_in_string=matrix_in_string.replace("matrix","numpy.matrix")
238     exec("matrix="+matrix_in_string)
239     matrix = numpy.matrix(matrix)
240 else:
241     matrix_in_string=matrix_in_string.replace("'","").replace('"','')
242     matrix = numpy.matrix(matrix_in_string)
243 type = "Matrix"
244 logging.debug("CREATE YI Matrix is %s"%matrix)
245 ]]></code></script>
246     <inport name="matrix_in_string" type="string"/>
247     <outport name="matrix" type="pyobj"/>
248     <outport name="type" type="string"/>
249     <outport name="stored" type="bool"/>
250   </inline>
251
252   <inline name="CreateNumpyScalarSparseMatrixFromString">
253     <script><code><![CDATA[
254 import numpy, logging
255 logging.debug("CREATE YI Entering in CreateNumpyScalarSparseMatrixFromString")
256 if (matrix_in_string.find("array")>-1) or (matrix_in_string.find("matrix")>-1):
257     matrix_in_string=matrix_in_string.replace("array","numpy.array")
258     matrix_in_string=matrix_in_string.replace("matrix","numpy.matrix")
259     exec("matrix="+matrix_in_string)
260     matrix = numpy.matrix(matrix)
261 else:
262     matrix_in_string=matrix_in_string.replace("'","").replace('"','')
263     matrix = numpy.matrix(matrix_in_string)
264 type = "ScalarSparseMatrix"
265 logging.debug("CREATE YI ScalarSparseMatrix is %s"%matrix)
266 ]]></code></script>
267     <inport name="matrix_in_string" type="string"/>
268     <outport name="matrix" type="pyobj"/>
269     <outport name="type" type="string"/>
270     <outport name="stored" type="bool"/>
271   </inline>
272
273   <inline name="CreateNumpyDiagonalSparseMatrixFromString">
274     <script><code><![CDATA[
275 import numpy, logging
276 logging.debug("CREATE YI Entering in CreateNumpyDiagonalSparseMatrixFromString")
277 if (matrix_in_string.find("array")>-1) or (matrix_in_string.find("matrix")>-1):
278     matrix_in_string=matrix_in_string.replace("array","numpy.array")
279     matrix_in_string=matrix_in_string.replace("matrix","numpy.matrix")
280     exec("matrix="+matrix_in_string)
281     matrix = numpy.matrix(matrix)
282 else:
283     matrix_in_string=matrix_in_string.replace("'","").replace('"','')
284     matrix = numpy.matrix(matrix_in_string)
285 type = "DiagonalSparseMatrix"
286 logging.debug("CREATE YI DiagonalSparseMatrix is %s"%matrix)
287 ]]></code></script>
288     <inport name="matrix_in_string" type="string"/>
289     <outport name="matrix" type="pyobj"/>
290     <outport name="type" type="string"/>
291     <outport name="stored" type="bool"/>
292   </inline>
293
294   <inline name="CreateNumpyMatrixFromScript">
295     <script><code><![CDATA[
296 import logging, sys, os
297 logging.debug("CREATE YI Entering in CreateNumpyMatrixFromScript")
298 type = "Matrix"
299
300 # Get file path and filename
301 try:
302     if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
303         sys.path.insert(0,studydir)
304 except:
305     pass
306 filepath = os.path.dirname(script)
307 filename = os.path.basename(script)
308 module_name = os.path.splitext(filename)[0]
309 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
310     sys.path.insert(0,filepath)
311
312 ]]></code></script>
313     <inport name="script" type="string"/>
314     <outport name="type" type="string"/>
315     <outport name="stored" type="bool"/>
316   </inline>
317
318   <inline name="CreateNumpyScalarSparseMatrixFromScript">
319     <script><code><![CDATA[
320 import logging, sys, os
321 logging.debug("CREATE YI Entering in CreateNumpyScalarSparseMatrixFromScript")
322 type = "ScalarSparseMatrix"
323
324 # Get file path and filename
325 try:
326     if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
327         sys.path.insert(0,studydir)
328 except:
329     pass
330 filepath = os.path.dirname(script)
331 filename = os.path.basename(script)
332 module_name = os.path.splitext(filename)[0]
333 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
334     sys.path.insert(0,filepath)
335
336 ]]></code></script>
337     <inport name="script" type="string"/>
338     <outport name="type" type="string"/>
339     <outport name="stored" type="bool"/>
340   </inline>
341
342   <inline name="CreateNumpyDiagonalSparseMatrixFromScript">
343     <script><code><![CDATA[
344 import logging, sys, os
345 logging.debug("CREATE YI Entering in CreateNumpyDiagonalSparseMatrixFromScript")
346 type = "DiagonalSparseMatrix"
347
348 # Get file path and filename
349 try:
350     if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
351         sys.path.insert(0,studydir)
352 except:
353     pass
354 filepath = os.path.dirname(script)
355 filename = os.path.basename(script)
356 module_name = os.path.splitext(filename)[0]
357 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
358     sys.path.insert(0,filepath)
359
360 ]]></code></script>
361     <inport name="script" type="string"/>
362     <outport name="type" type="string"/>
363     <outport name="stored" type="bool"/>
364   </inline>
365
366   <inline name="CreateNumpyVectorFromString">
367     <script><code><![CDATA[
368 import numpy, logging
369 logging.debug("CREATE YI Entering in CreateNumpyVectorFromString")
370 if (vector_in_string.find("array")>-1) or (vector_in_string.find("matrix")>-1):
371     vector_in_string=vector_in_string.replace("array","numpy.array")
372     vector_in_string=vector_in_string.replace("matrix","numpy.matrix")
373     exec("vector="+vector_in_string)
374     vector = numpy.matrix(vector)
375 else:
376     vector_in_string=vector_in_string.replace("'","").replace('"','')
377     vector = numpy.matrix(vector_in_string)
378 type = "Vector"
379 logging.debug("Vector is %s"%vector)
380 ]]></code></script>
381     <inport name="vector_in_string" type="string"/>
382     <outport name="vector" type="pyobj"/>
383     <outport name="type" type="string"/>
384     <outport name="stored" type="bool"/>
385   </inline>
386
387   <inline name="CreateNumpyVectorFromScript">
388     <script><code><![CDATA[
389 import logging, sys, os
390 logging.debug("CREATE YI Entering in CreateNumpyVectorFromScript")
391 type = "Vector"
392
393 # Get file path and filename
394 try:
395     if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
396         sys.path.insert(0,studydir)
397 except:
398     pass
399 filepath = os.path.dirname(script)
400 filename = os.path.basename(script)
401 module_name = os.path.splitext(filename)[0]
402 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
403     sys.path.insert(0,filepath)
404
405 ]]></code></script>
406     <inport name="script" type="string"/>
407     <outport name="type" type="string"/>
408     <outport name="stored" type="bool"/>
409   </inline>
410
411   <inline name="CreateNumpyVectorSerieFromString">
412     <script><code><![CDATA[
413 import numpy, logging
414 logging.debug("CREATE YI Entering in CreateNumpyVectorSerieFromString")
415 vector_in_list = eval(str(vector_in_string),{},{})
416 vector = numpy.matrix(vector_in_list)
417 type = "VectorSerie"
418 logging.debug("VectorSerie is %s"%vector)
419 ]]></code></script>
420     <inport name="vector_in_string" type="string"/>
421     <outport name="vector" type="pyobj"/>
422     <outport name="type" type="string"/>
423     <outport name="stored" type="bool"/>
424   </inline>
425
426   <inline name="CreateNumpyVectorSerieFromScript">
427     <script><code><![CDATA[
428 import logging, sys, os
429 logging.debug("CREATE YI Entering in CreateNumpyVectorSerieFromScript")
430 type = "VectorSerie"
431
432 # Get file path and filename
433 try:
434     if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
435         sys.path.insert(0,studydir)
436 except:
437     pass
438 filepath = os.path.dirname(script)
439 filename = os.path.basename(script)
440 module_name = os.path.splitext(filename)[0]
441 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
442     sys.path.insert(0,filepath)
443
444 ]]></code></script>
445     <inport name="script" type="string"/>
446     <outport name="type" type="string"/>
447     <outport name="stored" type="bool"/>
448   </inline>
449
450   <inline name="SimpleExecuteDirectAlgorithm">
451     <script><code><![CDATA[
452 import logging
453 logging.debug("EXECUTE Entering in SimpleExecuteDirectAlgorithm")
454 from daYacsIntegration.daStudy import *
455 ADD = Study.getResults()
456 ADD.analyze()
457 ]]></code></script>
458     <inport name="Study" type="pyobj"/>
459     <outport name="Study" type="pyobj"/>
460   </inline>
461
462   <inline name="SimpleUserAnalysis">
463     <script><code><![CDATA[
464 #-*- coding: utf-8 -*-
465 import sys, logging
466 logging.debug("TERMINATE Entering in SimpleUserAnalysis")
467 if sys.version_info.major < 3:
468     ADD = Study.getResults()
469 else:
470     ADD = Study
471 # User code is below
472
473 ]]></code></script>
474     <inport name="Study" type="pyobj"/>
475   </inline>
476
477   <inline name="FakeOptimizerLoopNode">
478     <script><code><![CDATA[
479 import logging
480 logging.debug("EXECUTE Entering in FakeOptimizerLoopNode")
481 result = None
482 ]]></code></script>
483     <inport name="computation" type="SALOME_TYPES/ParametricInput"/>
484     <outport name="result" type="SALOME_TYPES/ParametricOutput"/>
485   </inline>
486
487   <inline name="CreateDictFromString">
488     <script><code><![CDATA[
489 import logging, sys, os
490 logging.debug("CREATE YI Entering in CreateDictFromString")
491 dico = eval(dict_in_string)
492 ]]></code></script>
493     <inport name="dict_in_string" type="string"/>
494   </inline>
495
496   <inline name="CreateDictFromScript">
497     <script><code><![CDATA[
498 import logging, sys, os
499 logging.debug("CREATE YI Entering in CreateDictFromScript")
500
501 # Get file path and filename
502 try:
503     if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
504         sys.path.insert(0,studydir)
505 except:
506     pass
507 filepath = os.path.dirname(script)
508 filename = os.path.basename(script)
509 module_name = os.path.splitext(filename)[0]
510 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
511     sys.path.insert(0,filepath)
512
513 ]]></code></script>
514     <inport name="script" type="string"/>
515   </inline>
516
517   <inline name="UserDataInitFromScript">
518     <script><code><![CDATA[
519 import logging, sys, os
520 logging.debug("CREATE YI Entering in UserDataInitFromScript")
521
522 # Get file path and filename
523 try:
524     if sys.path.count(studydir)==0 or (sys.path.count(studydir)>0 and sys.path.index(studydir)>0):
525         sys.path.insert(0,studydir)
526 except:
527     pass
528 filepath = os.path.dirname(script)
529 filename = os.path.basename(script)
530 module_name = os.path.splitext(filename)[0]
531 if sys.path.count(filepath)==0 or (sys.path.count(filepath)>0 and sys.path.index(filepath)>0):
532     sys.path.insert(0,filepath)
533
534 ]]></code></script>
535     <inport name="script" type="string"/>
536     <outport name="init_data" type="pyobj"/>
537   </inline>
538
539   <inline name="ReadForSwitchNode">
540     <script><code><![CDATA[import sys, logging
541 if sys.version_info.major > 3: import adao
542 logging.debug("CREATE YI Entering in ReadForSwitchNode")
543 logging.debug("       with input data : ",list(data["specificParameters"]))
544 switch_value = -1
545 for param in data["specificParameters"]:
546   if param["name"] == "switch_value":
547     switch_value = int(param["value"])
548 logging.debug("       switching to value : "+str(switch_value))
549 ]]></code></script>
550     <inport name="data" type="SALOME_TYPES/ParametricInput"/>
551     <outport name="data" type="SALOME_TYPES/ParametricInput"/>
552     <outport name="switch_value" type="int"/>
553   </inline>
554
555   <inline name="ExtractDataNode">
556     <script><code><![CDATA[import sys, logging
557 if sys.version_info.major > 3: import adao
558 logging.debug("TERMINATE Entering in ExtractDataNode")
559 from daCore.AssimilationStudy import AssimilationStudy
560 var = None
561 info = None
562 for param in data["specificParameters"]:
563   if param["name"] == "var":
564     var = param["value"]
565   if param["name"] == "info":
566     info = param["value"]
567 ]]></code></script>
568     <inport name="data" type="SALOME_TYPES/ParametricInput"/>
569     <outport name="var" type="pyobj"/>
570     <outport name="info" type="pyobj"/>
571   </inline>
572
573   <inline name="ObservationNodeString">
574     <script><code><![CDATA[]]></code></script>
575     <inport name="var" type="pyobj"/>
576     <inport name="info" type="pyobj"/>
577   </inline>
578
579   <inline name="ObservationNodeFile">
580     <script><code><![CDATA[execfile(script)]]></code></script>
581     <inport name="var"    type="pyobj"/>
582     <inport name="info"   type="pyobj"/>
583     <inport name="script" type="string"/>
584   </inline>
585
586   <inline name="EndObservationNode">
587     <script><code><![CDATA[
588 # Create a fake output object.
589 # An observer is always successful.
590 output = {}
591 output["outputValues"]        = [[[[]]]]
592 output["specificOutputInfos"] = []
593 output["returnCode"]          = 0
594 output["errorMessage"]        = ""
595 ]]></code></script>
596     <outport name="output" type="SALOME_TYPES/ParametricOutput"/>
597   </inline>
598
599   <inline name="SetObserversNode">
600     <script><code><![CDATA[
601 #print("Setting observers")
602 ]]></code></script>
603     <outport name="has_observers" type="bool"/>
604     <outport name="observers" type="pyobj"/>
605   </inline>
606 </proc>