Salome HOME
Modifying EFICAS tree and commands, adding case translation
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Thu, 26 Feb 2015 19:33:48 +0000 (20:33 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 1 Mar 2015 15:59:53 +0000 (16:59 +0100)
36 files changed:
bin/AdaoCatalogGenerator.py
doc/en/images/adao_algopar_defaults.png [new file with mode: 0644]
doc/en/images/adao_algopar_script.png
doc/en/images/adao_algopar_string.png
doc/en/ref_assimilation_keywords.rst
doc/en/ref_checking_keywords.rst
doc/fr/images/adao_algopar_defaults.png [new file with mode: 0644]
doc/fr/images/adao_algopar_script.png
doc/fr/images/adao_algopar_string.png
doc/fr/ref_assimilation_keywords.rst
doc/fr/ref_checking_keywords.rst
examples/daSalome/test001_ADAO_JDC_using_strings.comm
examples/daSalome/test002_ADAO_JDC_using_strings.comm
examples/daSalome/test003_ADAO_JDC_using_scripts.comm.in
examples/daSalome/test003_bis_ADAO_JDC_using_user_data_init.comm.in
examples/daSalome/test004_ADAO_JDC_using_scripts.comm.in
examples/daSalome/test005_ADAO_Operators.comm.in
examples/daSalome/test006_Observers.comm.in
examples/daSalome/test006_Observers.py.in
examples/daSalome/test008_ADAO_Elementary_GradientTest.comm
examples/daSalome/test008_ADAO_Elementary_GradientTest.py
examples/daSalome/test009_ADAO_Simple_GradientTest.comm
examples/daSalome/test009_ADAO_Simple_GradientTest.py
examples/daSalome/test010_ADAO_Simple_AdjointTest.comm
examples/daSalome/test010_ADAO_Simple_AdjointTest.py
src/daComposant/daAlgorithms/3DVAR.py
src/daComposant/daAlgorithms/ExtendedKalmanFilter.py
src/daComposant/daAlgorithms/NonLinearLeastSquares.py
src/daComposant/daAlgorithms/ParticleSwarmOptimization.py
src/daComposant/daAlgorithms/QuantileRegression.py
src/daComposant/daAlgorithms/UnscentedKalmanFilter.py
src/daEficas/Makefile.am
src/daEficas/generator_adao.py
src/daEficas/traduitADAOV7_4_0ToV7_6_0.py [new file with mode: 0644]
src/daEficas/traduitADAOV7_5_0ToV7_6_0.py [new file with mode: 0644]
src/daEficas/traduitADAOV7_5_1ToV7_6_0.py [new file with mode: 0644]

index 008438d67a32ef32c3baad1958231fb6833347d5..71315402bbc1057dc129eef3b5ed5cb9332b9cd6 100644 (file)
@@ -5,7 +5,7 @@
 # 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 General Public
+# modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
 # version 2.1 of the License.
 #
@@ -18,6 +18,8 @@
 # License along with this library; if not, write to the Free Software
 # 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
 
 import logging
@@ -31,65 +33,80 @@ import module_version
 logging.basicConfig(level=logging.WARNING)
 
 #----------- Templates Part ---------------#
-begin_catalog_file = """# -*- coding: utf-8 -*-
+begin_catalog_file = """#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2015 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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# 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
 
 # --------------------------------------------------------
-# generated by AdaoCatalogGenerator at ${date}
+# Generated by AdaoCatalogGenerator on ${date}
 # --------------------------------------------------------
 
 import Accas
 from Accas import *
 
-JdC = JDC_CATA (code = '%s',
-                execmodul = None,
-                regles = ( AU_MOINS_UN ('ASSIMILATION_STUDY','CHECKING_STUDY'), AU_PLUS_UN ('ASSIMILATION_STUDY','CHECKING_STUDY')),
-               )
+JdC = JDC_CATA (
+    code = '%s',
+    execmodul = None,
+    regles = ( AU_MOINS_UN ('ASSIMILATION_STUDY','CHECKING_STUDY'), AU_PLUS_UN ('ASSIMILATION_STUDY','CHECKING_STUDY')),
+    )
 VERSION_CATALOGUE='%s'
 """%(module_version.name,module_version.version)
 
 data_method = """
-def F_${data_name}(statut) : return FACT(statut = statut,
-                                         FROM = SIMP(statut = "o", typ = "TXM", into=(${data_into}), defaut=${data_default}),
-                                         SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
-
-                                                      SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant si nécessaire la définition d'une variable interne de même nom que le concept parent", ang="Waiting for a script file name, with or without the full path to find it, containing if necessary the definition of an internal variable of the same name as the parent concept"),
-                                                     ),
-                                         STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
-
-                                                      STRING = SIMP(statut = "o", typ = "TXM",${ms_default} fr="En attente d'une chaine de caractères entre guillements. Pour construire un vecteur ou une matrice, ce doit être une suite de nombres, utilisant un espace ou une virgule pour séparer deux éléments et un point-virgule pour séparer deux lignes", ang="Waiting for a string in quotes. To build a vector or a matrix, it has to be a float serie, using a space or comma to separate two elements in a line, a semi-colon to separate rows"),
-                                                     ),
-                                         SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
-
-                                                      SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant en variables internes trois fonctions de calcul nommées DirectOperator, TangentOperator et AdjointOperator", ang="Waiting for a script file name, with or without the full path to find it, containing as internal variables three computation functions named DirectOperator, TangentOperator and AdjointOperator"),
-                                                     ),
-                                         SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
-
-                                                      SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant en variable interne une seule fonction de calcul nommée DirectOperator", ang="Waiting for a script file name, with or without the full path to find it, containing as internal variable only one function named DirectOperator"),
-                                                      DifferentialIncrement = SIMP(statut="o", typ = "R", val_min=0, val_max=1, defaut=0.01, fr="Incrément de la perturbation dX pour calculer la dérivée, construite en multipliant X par l'incrément en évitant les valeurs nulles", ang="Increment of dX perturbation to calculate the derivative, build multiplying X by the increment avoiding null values"),
-                                                      CenteredFiniteDifference = SIMP(statut="o", typ = "I", into=(0, 1), defaut=0, fr="Formulation centrée (1) ou décentrée (0) pour la méthode des différences finies", ang="Centered (1) or uncentered (0) formulation for the finite differences method"),
-                                                      EnableMultiProcessing = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0, fr="EXPERIMENTAL : Calculs élémentaires effectués en séquentiel (0) ou en parallèle (1) dans la méthode des différences finies", ang="EXPERIMENTAL: Elementary calculations done sequentially (0) or in parallel (1) in the finite differences method"),
-                                                     ),
-                                         SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
-
-                                                      SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant un switch pour les calculs direct, tangent et adjoint", ang="Waiting for a script file name, with or without the full path to find it, containing a switch for direct, tangent and adjoint computations"),
-                                                     ),
-                                         FUNCTIONDICT_DATA = BLOC ( condition = " FROM in ( 'FunctionDict', ) ",
-
-                                                      FUNCTIONDICT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="OBSOLETE : conservé pour compatibilité avec la version 6.5, sera supprimé dans le futur", ang="OBSOLETE: keeped for compatibility with the 6.5 version, will be removed in the future"),
-                                                     ),
-                                         TEMPLATE_DATA =  BLOC (condition = " FROM in ( 'Template', ) ",
-                                             Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
-                                             AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
-                                                 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nprint 'Analysis:',xa" ),
-                                             ),
-                                             AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
-                                                 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nf='/tmp/analysis.txt'\\nprint 'Analysis saved in \\"%s\\"'%f\\nnumpy.savetxt(f,xa)" ),
-                                             ),
-                                             AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
-                                                 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nprint 'Analysis:',xa\\nf='/tmp/analysis.txt'\\nprint 'Analysis saved in \\"%s\\"'%f\\nnumpy.savetxt(f,xa)" ),
-                                             ),
-                                         ),
-                                    )
+def F_${data_name}(statut) : return FACT(
+    statut = statut,
+    FROM = SIMP(statut = "o", typ = "TXM", into=(${data_into}), defaut=${data_default}),
+    SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
+        SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant si nécessaire la définition d'une variable interne de même nom que le concept parent", ang="Waiting for a script file name, with or without the full path to find it, containing if necessary the definition of an internal variable of the same name as the parent concept"),
+        ),
+    STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
+        STRING = SIMP(statut = "o", typ = "TXM",${ms_default} fr="En attente d'une chaine de caractères entre guillements. Pour construire un vecteur ou une matrice, ce doit être une suite de nombres, utilisant un espace ou une virgule pour séparer deux éléments et un point-virgule pour séparer deux lignes", ang="Waiting for a string in quotes. To build a vector or a matrix, it has to be a float serie, using a space or comma to separate two elements in a line, a semi-colon to separate rows"),
+        ),
+    SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
+        SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant en variables internes trois fonctions de calcul nommées DirectOperator, TangentOperator et AdjointOperator", ang="Waiting for a script file name, with or without the full path to find it, containing as internal variables three computation functions named DirectOperator, TangentOperator and AdjointOperator"),
+        ),
+    SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
+        SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant en variable interne une seule fonction de calcul nommée DirectOperator", ang="Waiting for a script file name, with or without the full path to find it, containing as internal variable only one function named DirectOperator"),
+        DifferentialIncrement = SIMP(statut="o", typ = "R", val_min=0, val_max=1, defaut=0.01, fr="Incrément de la perturbation dX pour calculer la dérivée, construite en multipliant X par l'incrément en évitant les valeurs nulles", ang="Increment of dX perturbation to calculate the derivative, build multiplying X by the increment avoiding null values"),
+        CenteredFiniteDifference = SIMP(statut="o", typ = "I", into=(0, 1), defaut=0, fr="Formulation centrée (1) ou décentrée (0) pour la méthode des différences finies", ang="Centered (1) or uncentered (0) formulation for the finite differences method"),
+        EnableMultiProcessing = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0, fr="Calculs élémentaires effectués en séquentiel (0) ou en parallèle (1) dans la méthode des différences finies", ang="Elementary calculations done sequentially (0) or in parallel (1) in the finite differences method"),
+        ),
+    SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
+        SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()), fr="En attente d'un nom de fichier script, avec ou sans le chemin complet pour le trouver, contenant un switch pour les calculs direct, tangent et adjoint", ang="Waiting for a script file name, with or without the full path to find it, containing a switch for direct, tangent and adjoint computations"),
+        ),
+    TEMPLATE_DATA =  BLOC (condition = " FROM in ( 'Template', ) ",
+        Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
+        AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
+            ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nprint 'Analysis:',xa" ),
+            ),
+        AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
+            ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nf='/tmp/analysis.txt'\\nprint 'Analysis saved in \\"%s\\"'%f\\nnumpy.savetxt(f,xa)" ),
+            ),
+        AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
+            ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\\nxa=numpy.ravel(ADD.get('Analysis')[-1])\\nprint 'Analysis:',xa\\nf='/tmp/analysis.txt'\\nprint 'Analysis saved in \\"%s\\"'%f\\nnumpy.savetxt(f,xa)" ),
+            ),
+        ),
+    )
 """
 
 init_method = """
@@ -105,122 +122,137 @@ def F_InitChoice() : return  ("Background",
                              )
 
 def F_Init(statut) : return FACT(statut = statut,
-                                 INIT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr())),
-                                 TARGET_LIST = SIMP(statut = "o", typ = "TXM", min=1, max="**", into=F_InitChoice(),  validators=(VerifExiste(2))),
-                                )
+    INIT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr())),
+    TARGET_LIST = SIMP(statut = "o", typ = "TXM", min=1, max="**", into=F_InitChoice(),  validators=(VerifExiste(2))),
+    )
 """
 
 assim_data_method = """
-def F_${assim_name}(statut) : return FACT(statut=statut,
+def F_${assim_name}(statut) : return FACT(
+    statut=statut,
 ${storage}
-                                          INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=(${choices}), defaut=${default_choice}),
-${decl_choices}
-                                                )
+    INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=(${choices}), defaut=${default_choice}),${decl_choices}
+    )
 """
 
 assim_data_choice = """
-                                                 ${choice_name} = BLOC ( condition = " INPUT_TYPE in ( '${choice_name}', ) ",
-                                                 data = F_${choice_name}("o"),
-                                                 ),
-"""
+    ${choice_name} = BLOC ( condition = " INPUT_TYPE in ( '${choice_name}', ) ",
+        data = F_${choice_name}("o"),
+        ),"""
 
 observers_choice = """
-                                       ${var_name} = BLOC (condition=" '${var_name}' in set(SELECTION) ",
-                                           ${var_name}_data = FACT(statut = "o",
-                                               Scheduler    = SIMP(statut = "f", typ = "TXM"),
-                                               Info         = SIMP(statut = "o", typ = "TXM", defaut = "${var_name}"),
-                                               NodeType     = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
-                                               PythonScript = BLOC (condition = " NodeType == 'String' ",
-                                                   Value = SIMP(statut = "o", typ = "TXM")
-                                               ),
-                                               UserFile = BLOC (condition = " NodeType == 'Script' ",
-                                                   Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()))
-                                               ),
-                                               ObserverTemplate =  BLOC (condition = " NodeType == 'Template' ",
-                                                   Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "ValuePrinter", into=("ValuePrinter", "ValueSeriePrinter", "ValueSaver", "ValueSerieSaver", "ValuePrinterAndSaver", "ValueSeriePrinterAndSaver", "ValueGnuPlotter", "ValueSerieGnuPlotter")),
-                                                   ValuePrinter = BLOC (condition = " Template == 'ValuePrinter' ",
-                                                       ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info,var[-1]" ),
-                                                   ),
-                                                   ValueSeriePrinter = BLOC (condition = " Template == 'ValueSeriePrinter' ",
-                                                       ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info,var[:]" ),
-                                                   ),
-                                                   ValueSaver = BLOC (condition = " Template == 'ValueSaver' ",
-                                                       ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[-1]))\\nglobal istep\\ntry:\\n    istep += 1\\nexcept:\\n    istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
-                                                   ),
-                                                   ValueSerieSaver = BLOC (condition = " Template == 'ValueSerieSaver' ",
-                                                       ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[:])) \\nglobal istep\\ntry:\\n    istep += 1\\nexcept:\\n    istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
-                                                   ),
-                                                   ValuePrinterAndSaver = BLOC (condition = " Template == 'ValuePrinterAndSaver' ",
-                                                       ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[-1]))\\nprint info,v\\nglobal istep\\ntry:\\n    istep += 1\\nexcept:\\n    istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
-                                                   ),
-                                                   ValueSeriePrinterAndSaver = BLOC (condition = " Template == 'ValueSeriePrinterAndSaver' ",
-                                                       ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[:])) \\nprint info,v\\nglobal istep\\ntry:\\n    istep += 1\\nexcept:\\n    istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
-                                                   ),
-                                                   ValueGnuPlotter = BLOC (condition = " Template == 'ValueGnuPlotter' ",
-                                                       ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal ifig,gp\\ntry:\\n    ifig += 1\\n    gp('set style data lines')\\nexcept:\\n    ifig = 0\\n    gp = Gnuplot.Gnuplot(persist=1)\\n    gp('set style data lines')\\ngp('set title  \\"%s (Figure %i)\\"'%(info,ifig))\\ngp.plot( Gnuplot.Data( var[-1], with_='lines lw 2' ) )" ),
-                                                   ),
-                                                   ValueSerieGnuPlotter = BLOC (condition = " Template == 'ValueSerieGnuPlotter' ",
-                                                       ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal ifig,gp\\ntry:\\n    ifig += 1\\n    gp('set style data lines')\\nexcept:\\n    ifig = 0\\n    gp = Gnuplot.Gnuplot(persist=1)\\n    gp('set style data lines')\\ngp('set title  \\"%s (Figure %i)\\"'%(info,ifig))\\ngp.plot( Gnuplot.Data( var[:], with_='lines lw 2' ) )" ),
-                                                   ),
-                                               ),
-                                           ),
-                                       ),
-"""
+    ${var_name} = BLOC (condition=" '${var_name}' in set(SELECTION) ",
+        ${var_name}_data = FACT(statut = "o",
+            Scheduler    = SIMP(statut = "f", typ = "TXM"),
+            Info         = SIMP(statut = "o", typ = "TXM", defaut = "${var_name}"),
+            NodeType     = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
+            PythonScript = BLOC (condition = " NodeType == 'String' ",
+                Value = SIMP(statut = "o", typ = "TXM")
+                ),
+            UserFile = BLOC (condition = " NodeType == 'Script' ",
+                Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=(OnlyStr()))
+                ),
+            ObserverTemplate = F_ObserverTemplate(),
+            ),
+        ),"""
 
 observers_method = """
-def F_Observers(statut) : return FACT(statut=statut,
-                                      SELECTION = SIMP(statut="o", defaut=[], typ="TXM", min=0, max="**", validators=NoRepeat(), into=(${choices})),
-${decl_choices}
-                                     )
+def F_ObserverTemplate() : return BLOC(condition = " NodeType == 'Template' ",
+                Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "ValuePrinter", into=("ValuePrinter", "ValueSeriePrinter", "ValueSaver", "ValueSerieSaver", "ValuePrinterAndSaver", "ValueSeriePrinterAndSaver", "ValueGnuPlotter", "ValueSerieGnuPlotter")),
+                ValuePrinter = BLOC (condition = " Template == 'ValuePrinter' ",
+                    ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info,var[-1]" ),
+                    ),
+                ValueSeriePrinter = BLOC (condition = " Template == 'ValueSeriePrinter' ",
+                    ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info,var[:]" ),
+                    ),
+                ValueSaver = BLOC (condition = " Template == 'ValueSaver' ",
+                    ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[-1]))\\nglobal istep\\ntry:\\n    istep += 1\\nexcept:\\n    istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
+                    ),
+                ValueSerieSaver = BLOC (condition = " Template == 'ValueSerieSaver' ",
+                    ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[:])) \\nglobal istep\\ntry:\\n    istep += 1\\nexcept:\\n    istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
+                    ),
+                ValuePrinterAndSaver = BLOC (condition = " Template == 'ValuePrinterAndSaver' ",
+                    ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[-1]))\\nprint info,v\\nglobal istep\\ntry:\\n    istep += 1\\nexcept:\\n    istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
+                    ),
+                ValueSeriePrinterAndSaver = BLOC (condition = " Template == 'ValueSeriePrinterAndSaver' ",
+                    ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy,re\\nv=numpy.array((var[:])) \\nprint info,v\\nglobal istep\\ntry:\\n    istep += 1\\nexcept:\\n    istep = 0\\nf='/tmp/value_%s_%05i.txt'%(info,istep)\\nf=re.sub('\s','_',f)\\nprint 'Value saved in \\"%s\\"'%f\\nnumpy.savetxt(f,v)" ),
+                    ),
+                ValueGnuPlotter = BLOC (condition = " Template == 'ValueGnuPlotter' ",
+                    ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal ifig,gp\\ntry:\\n    ifig += 1\\n    gp('set style data lines')\\nexcept:\\n    ifig = 0\\n    gp = Gnuplot.Gnuplot(persist=1)\\n    gp('set style data lines')\\ngp('set title  \\"%s (Figure %i)\\"'%(info,ifig))\\ngp.plot( Gnuplot.Data( var[-1], with_='lines lw 2' ) )" ),
+                    ),
+                ValueSerieGnuPlotter = BLOC (condition = " Template == 'ValueSerieGnuPlotter' ",
+                    ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import Gnuplot\\nglobal ifig,gp\\ntry:\\n    ifig += 1\\n    gp('set style data lines')\\nexcept:\\n    ifig = 0\\n    gp = Gnuplot.Gnuplot(persist=1)\\n    gp('set style data lines')\\ngp('set title  \\"%s (Figure %i)\\"'%(info,ifig))\\ngp.plot( Gnuplot.Data( var[:], with_='lines lw 2' ) )" ),
+                    ),
+                )
+
+def F_Observers(statut) : return FACT(
+    statut=statut,
+    SELECTION = SIMP(statut="o", defaut=[], typ="TXM", min=0, max="**", validators=NoRepeat(), into=(${choices})),${decl_choices}
+    )
+"""
+
+algo_choices = """
+def F_AlgorithmChoices(statut,algos_names) : return FACT(
+    statut = statut,
+    Algorithm = SIMP(statut="o", typ = "TXM", into = algos_names ),
+    Parameters = SIMP(statut="f", typ = "TXM", into=("Defaults", "Dict") ),
+    Dict = BLOC ( condition = " Parameters == 'Dict' ",
+        statut="f",
+        data = F_Dict("o"),
+        ),${all_algo_defaults}
+    )
 """
+one_algo_choices = """
+    Parameters${algo_name} = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == '${algo_name}') ",
+        statut="f",
+${algo_parameters}        ),"""
 
 assim_study = """
 
-def F_variables(statut) : return FACT(statut=statut,
-                                      regles = ( MEME_NOMBRE ('NAMES', 'SIZES')),
-                                      NAMES = SIMP(statut="o", typ="TXM", max="**", validators=NoRepeat()),
-                                      SIZES = SIMP(statut="o", typ="I", val_min=1, max="**")
-                                      )
+def F_variables(statut) : return FACT(
+    statut=statut,
+    regles = ( MEME_NOMBRE ('NAMES', 'SIZES')),
+    NAMES = SIMP(statut="o", typ="TXM", max="**", validators=NoRepeat()),
+    SIZES = SIMP(statut="o", typ="I", val_min=1, max="**")
+    )
 
 ASSIMILATION_STUDY = PROC(nom="ASSIMILATION_STUDY",
-                          op=None,
-                          repetable           = "n",
-                          Study_name          = SIMP(statut="o", typ = "TXM", defaut="ADAO Calculation Case"),
-                          Study_repertory     = SIMP(statut="f", typ = "Repertoire", min=1, max=1),
-                          Debug               = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0),
-                          Algorithm           = SIMP(statut="o", typ = "TXM", into=(${algos_names})),
-                          Background          = F_Background("o"),
-                          BackgroundError     = F_BackgroundError("o"),
-                          Observation         = F_Observation("o"),
-                          ObservationError    = F_ObservationError("o"),
-                          ObservationOperator = F_ObservationOperator("o"),
-                          EvolutionModel      = F_EvolutionModel("f"),
-                          EvolutionError      = F_EvolutionError("f"),
-                          ControlInput        = F_ControlInput("f"),
-                          AlgorithmParameters = F_AlgorithmParameters("f"),
-                          UserDataInit        = F_Init("f"),
-                          UserPostAnalysis    = F_UserPostAnalysis("o"),
-                          InputVariables      = F_variables("f"),
-                          OutputVariables     = F_variables("f"),
-                          Observers           = F_Observers("f")
-                         )
+    op=None,
+    repetable           = "n",
+    StudyName           = SIMP(statut="o", typ = "TXM", defaut="ADAO Calculation Case"),
+    StudyRepertory      = SIMP(statut="f", typ = "Repertoire", min=1, max=1),
+    Debug               = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0),
+    AlgorithmChoices    = F_AlgorithmChoices("o",(${algos_names})),
+    Background          = F_Background("o"),
+    BackgroundError     = F_BackgroundError("o"),
+    Observation         = F_Observation("o"),
+    ObservationError    = F_ObservationError("o"),
+    ObservationOperator = F_ObservationOperator("o"),
+    EvolutionModel      = F_EvolutionModel("f"),
+    EvolutionError      = F_EvolutionError("f"),
+    ControlInput        = F_ControlInput("f"),
+    UserDataInit        = F_Init("f"),
+    UserPostAnalysis    = F_UserPostAnalysis("o"),
+    InputVariables      = F_variables("f"),
+    OutputVariables     = F_variables("f"),
+    Observers           = F_Observers("f")
+    )
 
 CHECKING_STUDY = PROC(nom="CHECKING_STUDY",
-                          op=None,
-                          repetable           = "n",
-                          Study_name          = SIMP(statut="o", typ = "TXM", defaut="ADAO Checking Case"),
-                          Study_repertory     = SIMP(statut="f", typ = "Repertoire", min=1, max=1),
-                          Debug               = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0),
-                          Algorithm           = SIMP(statut="o", typ = "TXM", into=(${check_names})),
-                          CheckingPoint       = F_CheckingPoint("o"),
-                          BackgroundError     = F_BackgroundError("f"),
-                          Observation         = F_Observation("f"),
-                          ObservationError    = F_ObservationError("f"),
-                          ObservationOperator = F_ObservationOperator("o"),
-                          AlgorithmParameters = F_AlgorithmParameters("f"),
-                          UserDataInit        = F_Init("f"),
-                          Observers           = F_Observers("f")
-                         )
+    op=None,
+    repetable           = "n",
+    StudyName           = SIMP(statut="o", typ = "TXM", defaut="ADAO Checking Case"),
+    StudyRepertory      = SIMP(statut="f", typ = "Repertoire", min=1, max=1),
+    Debug               = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0),
+    AlgorithmChoices    = F_AlgorithmChoices("o",(${check_names})),
+    CheckingPoint       = F_CheckingPoint("o"),
+    BackgroundError     = F_BackgroundError("f"),
+    Observation         = F_Observation("f"),
+    ObservationError    = F_ObservationError("f"),
+    ObservationOperator = F_ObservationOperator("o"),
+    UserDataInit        = F_Init("f"),
+    Observers           = F_Observers("f")
+    )
 """
 
 begin_catalog_file = string.Template(begin_catalog_file)
@@ -230,6 +262,8 @@ assim_data_choice = string.Template(assim_data_choice)
 assim_study = string.Template(assim_study)
 observers_method = string.Template(observers_method)
 observers_choice = string.Template(observers_choice)
+algo_choices = string.Template(algo_choices)
+one_algo_choices = string.Template(one_algo_choices)
 
 #----------- End of Templates Part ---------------#
 
@@ -273,6 +307,23 @@ mem_file = StringIO.StringIO()
 from time import strftime
 mem_file.write(begin_catalog_file.substitute(date=strftime("%Y-%m-%d %H:%M:%S")))
 
+# Step initial: on obtient la liste des algos
+algos_names = ""
+check_names = ""
+decl_algos  = ""
+assim_study_object = daCore.AssimilationStudy.AssimilationStudy()
+algos_list = assim_study_object.get_available_algorithms()
+del assim_study_object
+for algo_name in algos_list:
+  if algo_name in infos.AssimAlgos:
+    logging.debug("An assimilation algorithm is found: " + algo_name)
+    algos_names += "\"" + algo_name + "\", "
+  elif algo_name in infos.CheckAlgos:
+    logging.debug("A checking algorithm is found: " + algo_name)
+    check_names += "\"" + algo_name + "\", "
+  else:
+    logging.debug("This algorithm is not considered: " + algo_name)
+
 # Step 1: A partir des infos, on cree les fonctions qui vont permettre
 # d'entrer les donnees utilisateur
 for data_input_name in infos.DataTypeDict.keys():
@@ -294,31 +345,32 @@ for data_input_name in infos.DataTypeDict.keys():
   mem_file.write(data_method.substitute(data_name    = data_name,
                                         data_into    = data_into,
                                         data_default = data_default,
-                                        ms_default   = ms_default))
+                                        ms_default   = ms_default,
+                                        algos_names  = algos_names+check_names))
 
 # Step 2: On cree les fonctions qui permettent de rentrer les donnees des algorithmes
 for assim_data_input_name in infos.AssimDataDict.keys():
-  logging.debug("An assimilation algorithm data input is found: " + assim_data_input_name)
-  assim_name = assim_data_input_name
+  logging.debug("An input function data input is found: " + assim_data_input_name)
+  assim_name = assim_data_input_name
   storage = ""
   choices = ""
   default_choice = ""
   decl_choices = ""
   decl_opts = ""
   if infos.AssimDataDefaultDict[assim_data_input_name] in infos.StoredAssimData:
-    storage = "                                          Stored = SIMP(statut=\"o\", typ = \"I\", into=(0, 1), defaut=0, fr=\"Choix de stockage interne ou non du concept parent\", ang=\"Choice of the storage or not of the parent concept\"),"
+    storage = "    Stored = SIMP(statut=\"o\", typ = \"I\", into=(0, 1), defaut=0, fr=\"Choix de stockage interne ou non du concept parent\", ang=\"Choice of the storage or not of the parent concept\"),"
   for choice in infos.AssimDataDict[assim_data_input_name]:
     choices += "\"" + choice + "\", "
     decl_choices += assim_data_choice.substitute(choice_name = choice)
     if choice in infos.StoredAssimData:
-      storage = "                                          Stored = SIMP(statut=\"o\", typ = \"I\", into=(0, 1), defaut=0, fr=\"Choix de stockage interne ou non du concept parent\", ang=\"Choice of the storage or not of the parent concept\"),"
+      storage = "    Stored = SIMP(statut=\"o\", typ = \"I\", into=(0, 1), defaut=0, fr=\"Choix de stockage interne ou non du concept parent\", ang=\"Choice of the storage or not of the parent concept\"),"
   default_choice = "\"" + infos.AssimDataDefaultDict[assim_data_input_name] + "\""
 
-  mem_file.write(assim_data_method.substitute(assim_name = assim_name,
-                                              storage = storage,
-                                              choices = choices,
-                                              decl_choices = decl_choices,
-                                              default_choice=default_choice))
+  mem_file.write(assim_data_method.substitute(assim_name = assim_data_input_name,
+                                              storage        = storage,
+                                              choices        = choices,
+                                              decl_choices   = decl_choices,
+                                              default_choice = default_choice))
 
 # Step 3: On ajoute les fonctions representant les options possibles
 for opt_name in infos.OptDict.keys():
@@ -339,7 +391,8 @@ for opt_name in infos.OptDict.keys():
   mem_file.write(data_method.substitute(data_name    = data_name,
                                         data_into    = data_into,
                                         data_default = data_default,
-                                        ms_default   = ms_default))
+                                        ms_default   = ms_default,
+                                        algos_names  = algos_names+check_names))
 
 # Step 4: On ajoute la methode optionnelle init
 # TODO uniformiser avec le step 3
@@ -352,23 +405,52 @@ for obs_var in infos.ObserversList:
 mem_file.write(observers_method.substitute(choices = infos.ObserversList,
                                            decl_choices = decl_choices))
 
-# Final step: Add algorithm and assim_study
-algos_names = ""
-check_names = ""
-decl_algos  = ""
-
-assim_study_object = daCore.AssimilationStudy.AssimilationStudy()
-algos_list = assim_study_object.get_available_algorithms()
-for algo_name in algos_list:
-  if algo_name in infos.AssimAlgos:
-    logging.debug("An assimilation algorithm is found: " + algo_name)
-    algos_names += "\"" + algo_name + "\", "
-  elif algo_name in infos.CheckAlgos:
-    logging.debug("A checking algorithm is found: " + algo_name)
-    check_names += "\"" + algo_name + "\", "
-  else:
-    logging.debug("This algorithm is not considered: " + algo_name)
+# Step 5: Add algorithmic choices
+
+all_names = eval((algos_names+check_names))
+all_algo_defaults = ""
+for algo in all_names:
+    assim_study_object = daCore.AssimilationStudy.AssimilationStudy()
+    assim_study_object.setAlgorithm(choice=algo)
+    par_dict = assim_study_object.getAlgorithmParameters(False)
+    par_keys = par_dict.keys()
+    par_keys.sort()
+    algo_parameters = ""
+    for pn in par_keys:
+        if pn in ("StoreInternalVariables",): continue
+        pt = par_dict[pn]["typecast"]
+        pd = par_dict[pn]["default"]
+        pm = par_dict[pn]["message"]
+        if par_dict[pn].has_key("minval") and par_dict[pn]["minval"] is not None:
+            vi = ", val_min=%s"%par_dict[pn]["minval"]
+        else:
+            vi = ""
+        if par_dict[pn].has_key("minval") and par_dict[pn]["maxval"] is not None:
+            vs = ", val_max=%s"%par_dict[pn]["maxval"]
+        else:
+            vs = ""
+        if   pt is int:
+            algo_parameters += """        %s = SIMP(statut="f", typ="I"%s%s, min=1, max=1, defaut=%s, fr="%s"),\n"""%(pn,vi,vs,int(pd),pm)
+        elif pt is float:
+            algo_parameters += """        %s = SIMP(statut="f", typ="R"%s%s, min=1, max=1, defaut=%s, fr="%s"),\n"""%(pn,vi,vs,float(pd),pm)
+        elif pt is bool:
+            algo_parameters += """        %s = SIMP(statut="f", typ="I", min=1, max=1, defaut=%s, fr="%s"),\n"""%(pn,int(pd),pm)
+        elif pt is str and par_dict[pn].has_key("listval"):
+            algo_parameters += """        %s = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="%s", into=%s, fr="%s"),\n"""%(pn,str(pd),par_dict[pn]["listval"],pm)
+        elif pt is tuple and par_dict[pn].has_key("listval"):
+            algo_parameters += """        %s = SIMP(statut="f", typ="TXM", max="**", into=%s, fr="%s"),\n"""%(pn,par_dict[pn]["listval"],pm)
+        else:
+            algo_parameters += """        %s = SIMP(statut="f", typ="TXM", fr="%s"),\n"""%(pn,pm)
+    del assim_study_object
+    if algo_parameters != "":
+        all_algo_defaults += one_algo_choices.substitute(
+            algo_name=algo,
+            algo_parameters=algo_parameters,
+            )
+
+mem_file.write(algo_choices.substitute(all_algo_defaults=all_algo_defaults))
 
+# Final step: Add algorithm and assim_study
 mem_file.write(assim_study.substitute(algos_names=algos_names,
                                       check_names=check_names,
                                       decl_algos=decl_algos))
diff --git a/doc/en/images/adao_algopar_defaults.png b/doc/en/images/adao_algopar_defaults.png
new file mode 100644 (file)
index 0000000..181972b
Binary files /dev/null and b/doc/en/images/adao_algopar_defaults.png differ
index e19b6ef2b6d1cdcf2f71bd86a6211deb0ba662d8..fb00575a5c3690a84e913aa196b1b2c7ff740026 100644 (file)
Binary files a/doc/en/images/adao_algopar_script.png and b/doc/en/images/adao_algopar_script.png differ
index bc4bf2d24e78091c0014cd6a093c55df8e24418b..5d4f86246bf74a9f56d01e2c36f07b3a389487fe 100644 (file)
Binary files a/doc/en/images/adao_algopar_string.png and b/doc/en/images/adao_algopar_string.png differ
index f0a8c70d74588661431de53d1b900fd7ac518d6e..1c04988e8cb0f4b053e9c15856d0ebee3b3f94fa 100644 (file)
@@ -43,8 +43,8 @@ List of commands and keywords for an ADAO calculation case
 .. index:: single: Observers
 .. index:: single: Observer Template
 .. index:: single: OutputVariables
-.. index:: single: Study_name
-.. index:: single: Study_repertory
+.. index:: single: StudyName
+.. index:: single: StudyRepertory
 .. index:: single: UserDataInit
 .. index:: single: UserPostAnalysis
 .. index:: single: UserPostAnalysis Template
@@ -151,11 +151,11 @@ The different commands are the following:
     physical variables that are bundled together in the output observation
     vector. This information is dedicated to data processed inside an algorithm.
 
-  Study_name
+  StudyName
     *Required command*. This is an open string to describe the ADAO study by a
     name or a sentence.
 
-  Study_repertory
+  StudyRepertory
     *Optional command*. If available, this directory is used as base name for
     calculation, and used to find all the script files, given by name without
     path, that can be used to define some other commands by scripts.
index 4eabc70467d570087b68796e1aaf16eb84bfef26..63126aaf9b30b9b5142dad2883401cbd50dbcb02 100644 (file)
@@ -38,8 +38,8 @@ List of commands and keywords for an ADAO checking case
 .. index:: single: Observer
 .. index:: single: Observers
 .. index:: single: Observer Template
-.. index:: single: Study_name
-.. index:: single: Study_repertory
+.. index:: single: StudyName
+.. index:: single: StudyRepertory
 .. index:: single: UserDataInit
 
 This set of commands is related to the description of a checking case, that is a
@@ -112,11 +112,11 @@ The different commands are the following:
     printing or plotting it, etc. Common templates are provided to help the user
     to start or to quickly make his case.
 
-  Study_name
+  StudyName
     *Required command*. This is an open string to describe the ADAO study by a
     name or a sentence.
 
-  Study_repertory
+  StudyRepertory
     *Optional command*. If available, this directory is used as base name for
     calculation, and used to find all the script files, given by name without
     path, that can be used to define some other commands by scripts.
diff --git a/doc/fr/images/adao_algopar_defaults.png b/doc/fr/images/adao_algopar_defaults.png
new file mode 100644 (file)
index 0000000..05a6272
Binary files /dev/null and b/doc/fr/images/adao_algopar_defaults.png differ
index e19b6ef2b6d1cdcf2f71bd86a6211deb0ba662d8..ecc4c4e3324bebd27d241bf0740b97e4eaec0b79 100644 (file)
Binary files a/doc/fr/images/adao_algopar_script.png and b/doc/fr/images/adao_algopar_script.png differ
index bc4bf2d24e78091c0014cd6a093c55df8e24418b..bef0aa8e36a59807e7753d7e0c84bfeed59ebaa8 100644 (file)
Binary files a/doc/fr/images/adao_algopar_string.png and b/doc/fr/images/adao_algopar_string.png differ
index fb237ddb78c1d15e4b6324fd1fe2531ece6cc676..b0a065666d27024afc1f600d42971108a5a91cc7 100644 (file)
@@ -43,8 +43,8 @@ Liste des commandes et mots-cl
 .. index:: single: Observers
 .. index:: single: Observer Template
 .. index:: single: OutputVariables
-.. index:: single: Study_name
-.. index:: single: Study_repertory
+.. index:: single: StudyName
+.. index:: single: StudyRepertory
 .. index:: single: UserDataInit
 .. index:: single: UserPostAnalysis
 .. index:: single: UserPostAnalysis Template
@@ -158,11 +158,11 @@ Les diff
     Cette information est destinée à être utilisée dans le traitement
     algorithmique interne des données.
 
-  Study_name
+  StudyName
     *Commande obligatoire*. C'est une chaîne de caractères quelconque pour
     décrire l'étude ADAO par un nom ou une déclaration.
 
-  Study_repertory
+  StudyRepertory
     *Commande optionnelle*. S'il existe, ce répertoire est utilisé comme base
     pour les calculs, et il est utilisé pour trouver les fichiers de script,
     donnés par nom sans répertoire, qui peuvent être utilisés pour définir
index 7ef59f989aef9a987f9abe68bec347485a02c401..147092f8fb57175945eaac598f5c45dc93b91a59 100644 (file)
@@ -38,8 +38,8 @@ Liste des commandes et mots-cl
 .. index:: single: Observer
 .. index:: single: Observers
 .. index:: single: Observer Template
-.. index:: single: Study_name
-.. index:: single: Study_repertory
+.. index:: single: StudyName
+.. index:: single: StudyRepertory
 .. index:: single: UserDataInit
 
 Ce jeu de commandes est lié à la description d'un cas de vérification, qui est
@@ -116,11 +116,11 @@ Les diff
     courants (squelettes) sont fournis pour aider l'utilisateur ou pour
     faciliter l'élaboration d'un cas.
 
-  Study_name
+  StudyName
     *Commande obligatoire*. C'est une chaîne de caractères quelconque pour
     décrire l'étude ADAO par un nom ou une déclaration.
 
-  Study_repertory
+  StudyRepertory
     *Commande optionnelle*. S'il existe, ce répertoire est utilisé comme base
     pour les calculs, et il est utilisé pour trouver les fichiers de script,
     donnés par nom sans répertoire, qui peuvent être utilisés pour définir
index 81133f3c86389acc718d4ae2566fc3eddc05000d..26c4d74413842fd68315af7ce05a51eaef30019f 100644 (file)
@@ -1,7 +1,7 @@
 
-ASSIMILATION_STUDY(Study_name='Test',
+ASSIMILATION_STUDY(StudyName='Test',
                    Debug=0,
-                   Algorithm='Blue',
+                   AlgorithmChoices=_F(Algorithm='Blue',),
                    Background=_F(Stored=0,
                                  INPUT_TYPE='Vector',
                                  data=_F(FROM='String',
@@ -28,3 +28,5 @@ ASSIMILATION_STUDY(Study_name='Test',
                                                   """import numpy
 xa=numpy.ravel(ADD.get('Analysis')[-1])
 print 'Analysis:',xa""",),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
+#CHECKSUM:05cc41b743bfb035b9bcc0bba13f31f8  -:FIN CHECKSUM
\ No newline at end of file
index 010f40ff5333b50e11ce67098b75cb024213d2af..407d76eee19790606b0bc2b6ff1b81fb99e3b8da 100644 (file)
@@ -1,7 +1,7 @@
 
-ASSIMILATION_STUDY(Study_name='Test',
+ASSIMILATION_STUDY(StudyName='Test',
                    Debug=0,
-                   Algorithm='3DVAR',
+                   AlgorithmChoices=_F(Algorithm='3DVAR',),
                    Background=_F(Stored=0,
                                  INPUT_TYPE='Vector',
                                  data=_F(FROM='String',
@@ -28,3 +28,5 @@ ASSIMILATION_STUDY(Study_name='Test',
                                                   """import numpy
 xa=numpy.ravel(ADD.get('Analysis')[-1])
 print 'Analysis:',xa""",),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
+#CHECKSUM:58b5740b60d070b936a5b8952002fa5b  -:FIN CHECKSUM
\ No newline at end of file
index c41dcd7e36efb67251c0c74c12bcf319dcfa246d..744b8786eaa0e6560521fcd6e2e540296629ffe5 100644 (file)
@@ -1,8 +1,7 @@
 
-ASSIMILATION_STUDY(Study_name='Test',
-                   Study_repertory='@prefix@/share/salome/adao_examples/daSalome',
-                   Debug=0,
-                   Algorithm='3DVAR',
+ASSIMILATION_STUDY(StudyName='Test',
+                   StudyRepertory='@prefix@/share/salome/adao_examples/daSalome',
+                   AlgorithmChoices=_F(Algorithm='3DVAR',),
                    Background=_F(Stored=0,
                                  INPUT_TYPE='Vector',
                                  data=_F(FROM='Script',
@@ -29,3 +28,4 @@ ASSIMILATION_STUDY(Study_name='Test',
                                                   """import numpy
 xa=numpy.ravel(ADD.get('Analysis')[-1])
 print 'Analysis:',xa""",),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
index bc03a7b82aea33faa0bf785e5a615e3b9344467b..b0f3868bb25b908567ce38ecdeb486d9a3486be3 100644 (file)
@@ -1,8 +1,7 @@
 
-ASSIMILATION_STUDY(Study_name='Test',
-                   Study_repertory='@prefix@/share/salome/adao_examples/daSalome',
-                   Debug=0,
-                   Algorithm='3DVAR',
+ASSIMILATION_STUDY(StudyName='Test',
+                   StudyRepertory='@prefix@/share/salome/adao_examples/daSalome',
+                   AlgorithmChoices=_F(Algorithm='3DVAR',),
                    Background=_F(Stored=0,
                                  INPUT_TYPE='Vector',
                                  data=_F(FROM='Script',
@@ -33,3 +32,4 @@ ASSIMILATION_STUDY(Study_name='Test',
                                                   """import numpy
 xa=numpy.ravel(ADD.get('Analysis')[-1])
 print 'Analysis:',xa""",),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
index f400c523a36fb66b4012442807f3fd4ba27a04c5..35a6febae28d21a82d18483547691af2163dacd5 100644 (file)
@@ -1,8 +1,7 @@
 
-ASSIMILATION_STUDY(Study_name='Test',
-                   Study_repertory='@prefix@/share/salome/adao_examples/daSalome',
-                   Debug=0,
-                   Algorithm='Blue',
+ASSIMILATION_STUDY(StudyName='Test',
+                   StudyRepertory='@prefix@/share/salome/adao_examples/daSalome',
+                   AlgorithmChoices=_F(Algorithm='Blue',),
                    Background=_F(Stored=0,
                                  INPUT_TYPE='Vector',
                                  data=_F(FROM='Script',
@@ -32,3 +31,4 @@ print "Size of Analysis = %i"%len(Xa)
 print "Min, mean, max   = %8.3f, %8.3f, %8.3f"%(min(Xa),numpy.mean(Xa),max(Xa))
 print
 """,),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
index 76f2c94a27b0bb2419afb0f73d63ba500f329dde..d2f71c68bbbc26d5289be7ad611a948c81e148d6 100644 (file)
@@ -1,8 +1,7 @@
 
-ASSIMILATION_STUDY(Study_name='Test',
-                   Study_repertory='@prefix@/share/salome/adao_examples/daSalome',
-                   Debug=0,
-                   Algorithm='3DVAR',
+ASSIMILATION_STUDY(StudyName='Test',
+                   StudyRepertory='@prefix@/share/salome/adao_examples/daSalome',
+                   AlgorithmChoices=_F(Algorithm='3DVAR',),
                    Background=_F(Stored=0,
                                  INPUT_TYPE='Vector',
                                  data=_F(FROM='String',
@@ -34,3 +33,4 @@ print "Size of Analysis.............= %i"%len(Xa)
 print "Min, mean, max of Analysis...= %8.3f, %8.3f, %8.3f"%(min(Xa),numpy.mean(Xa),max(Xa))
 print
 """,),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
index 97bcd4ecfcbd6850a6e873c51741139121673e91..62df329d2dae12794ad378635748e19a8d4e2642 100644 (file)
@@ -1,8 +1,10 @@
 
-ASSIMILATION_STUDY(Study_name='test_observers',
-                   Study_repertory='@prefix@/share/salome/adao_examples/daSalome',
-                   Debug=0,
-                   Algorithm='3DVAR',
+ASSIMILATION_STUDY(StudyName='test_observers',
+                   StudyRepertory='@prefix@/share/salome/adao_examples/daSalome',
+                   AlgorithmChoices=_F(Algorithm='3DVAR',
+                                       Parameters='Dict',
+                                       data=_F(FROM='Script',
+                                               SCRIPT_FILE='test006_Observers_var.py',),),
                    Background=_F(Stored=0,
                                  INPUT_TYPE='Vector',
                                  data=_F(FROM='Script',
@@ -23,13 +25,14 @@ ASSIMILATION_STUDY(Study_name='test_observers',
                                           INPUT_TYPE='Function',
                                           data=_F(FROM='FunctionDict',
                                                   FUNCTIONDICT_FILE='test006_Observers_Observation_Operator.py',),),
-                   AlgorithmParameters=_F(INPUT_TYPE='Dict',
-                                          data=_F(FROM='Script',
-                                                  SCRIPT_FILE='test006_Observers_var.py',),),
                    UserDataInit=_F(INIT_FILE='test006_Observers_init.py',
-                                   TARGET_LIST=
-                                   ('Background','BackgroundError','Observation',
-                                                 'ObservationError','AlgorithmParameters',),),
+                                   TARGET_LIST=('Background','BackgroundError','Observation','ObservationError',),),
+                   UserPostAnalysis=_F(FROM='Template',
+                                       Template='AnalysisPrinter',
+                                       ValueTemplate=
+                                                  """import numpy
+xa=numpy.ravel(ADD.get('Analysis')[-1])
+print 'Analysis:',xa""",),
                    Observers=_F(SELECTION=('CurrentState','CostFunctionJ',),
                                 CurrentState_data=_F(Info='CurrentState',
                                                      NodeType='Script',
@@ -56,3 +59,4 @@ print "       imageCost %s"%filename
 gp.hardcopy(filename=filename, color=1)
 numero += 1
 """,),),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
index da76ded2ad2e13b72f057a5220f874d3cc960f48..16b717e6f27c738f6d7d51738ca1f23c8f849e10 100644 (file)
@@ -4,6 +4,11 @@ study_config['StudyType'] = 'ASSIMILATION_STUDY'
 study_config['Name'] = 'test_observers'
 study_config['Debug'] = '0'
 study_config['Algorithm'] = '3DVAR'
+AlgorithmParameters_config = {} 
+AlgorithmParameters_config['Type'] = 'Dict'
+AlgorithmParameters_config['From'] = 'Script'
+AlgorithmParameters_config['Data'] = 'test006_Observers_var.py'
+study_config['AlgorithmParameters'] = AlgorithmParameters_config
 Background_config = {}
 Background_config['Type'] = 'Vector'
 Background_config['From'] = 'Script'
@@ -48,16 +53,17 @@ outputvariables_config['Order'] = ['adao_default']
 outputvariables_config['adao_default'] = -1
 study_config['OutputVariables'] = outputvariables_config
 study_config['Repertory'] = '@prefix@/share/salome/adao_examples/daSalome'
-AlgorithmParameters_config = {} 
-AlgorithmParameters_config['Type'] = 'Dict'
-AlgorithmParameters_config['From'] = 'Script'
-AlgorithmParameters_config['Data'] = 'test006_Observers_var.py'
-study_config['AlgorithmParameters'] = AlgorithmParameters_config
+Analysis_config = {}
+Analysis_config['From'] = 'String'
+Analysis_config['Data'] = """import numpy
+xa=numpy.ravel(ADD.get('Analysis')[-1])
+print 'Analysis:',xa"""
+study_config['UserPostAnalysis'] = Analysis_config
 Init_config = {}
 Init_config['Type'] = 'Dict'
 Init_config['From'] = 'Script'
 Init_config['Data'] = 'test006_Observers_init.py'
-Init_config['Target'] = ['Background','BackgroundError','Observation','ObservationError','AlgorithmParameters',]
+Init_config['Target'] = ['Background','BackgroundError','Observation','ObservationError',]
 study_config['UserDataInit'] = Init_config
 observers = {}
 observers["CostFunctionJ"] = {}
index 73973a0f22271a5ec568be82e4f8ca724ad94ed9..cef9bdfdfc5e988d7e32dfc2d4c89ab91bc2dc91 100644 (file)
@@ -1,7 +1,9 @@
 
-CHECKING_STUDY(Study_name='Elementary gradient test',
-               Debug=0,
-               Algorithm='GradientTest',
+CHECKING_STUDY(StudyName='Elementary gradient test',
+               AlgorithmChoices=_F(Algorithm='GradientTest',
+                                   Parameters='Dict',
+                                   data=_F(FROM='String',
+                                           STRING='{ "SetSeed" : 1000 }',),),
                CheckingPoint=_F(Stored=0,
                                 INPUT_TYPE='Vector',
                                 data=_F(FROM='String',
@@ -9,7 +11,6 @@ CHECKING_STUDY(Study_name='Elementary gradient test',
                ObservationOperator=_F(Stored=0,
                                       INPUT_TYPE='Matrix',
                                       data=_F(FROM='String',
-                                              STRING='1 0 0 ; 0 1 0 ; 0 0 1',),),
-               AlgorithmParameters=_F(INPUT_TYPE='Dict',
-                                      data=_F(FROM='String',
-                                              STRING='{ "SetSeed" : 1000 }',),),);
+                                              STRING='1 0 0 ; 0 1 0 ; 0 0 1',),),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
+#CHECKSUM:1b2edbf93b6252687f4a9dc33dc25dc0  -:FIN CHECKSUM
\ No newline at end of file
index 4d155073902072081c2b83b6e8223a5182ef429c..715d312592d3dcf6a1903d41886db5eadaf8c965 100644 (file)
@@ -4,6 +4,11 @@ study_config['StudyType'] = 'CHECKING_STUDY'
 study_config['Name'] = 'Elementary gradient test'
 study_config['Debug'] = '0'
 study_config['Algorithm'] = 'GradientTest'
+AlgorithmParameters_config = {} 
+AlgorithmParameters_config['Type'] = 'Dict'
+AlgorithmParameters_config['From'] = 'String'
+AlgorithmParameters_config['Data'] = '{ "SetSeed" : 1000 }'
+study_config['AlgorithmParameters'] = AlgorithmParameters_config
 CheckingPoint_config = {}
 CheckingPoint_config['Type'] = 'Vector'
 CheckingPoint_config['From'] = 'String'
@@ -24,8 +29,3 @@ outputvariables_config = {}
 outputvariables_config['Order'] = ['adao_default']
 outputvariables_config['adao_default'] = -1
 study_config['OutputVariables'] = outputvariables_config
-AlgorithmParameters_config = {} 
-AlgorithmParameters_config['Type'] = 'Dict'
-AlgorithmParameters_config['From'] = 'String'
-AlgorithmParameters_config['Data'] = '{ "SetSeed" : 1000 }'
-study_config['AlgorithmParameters'] = AlgorithmParameters_config
index 56da492b48232b528e82c9af4f0e67b9571c749b..e1746e5059ff82b809622eaf342d68f53d2b880b 100644 (file)
@@ -1,7 +1,9 @@
 
-CHECKING_STUDY(Study_name='Test',
-               Debug=0,
-               Algorithm='GradientTest',
+CHECKING_STUDY(StudyName='Test',
+               AlgorithmChoices=_F(Algorithm='GradientTest',
+                                   Parameters='Dict',
+                                   data=_F(FROM='String',
+                                           STRING='{ "SetSeed" : 1000 }',),),
                CheckingPoint=_F(Stored=0,
                                 INPUT_TYPE='Vector',
                                 data=_F(FROM='String',
@@ -9,7 +11,6 @@ CHECKING_STUDY(Study_name='Test',
                ObservationOperator=_F(Stored=0,
                                       INPUT_TYPE='Matrix',
                                       data=_F(FROM='String',
-                                              STRING='1 0 0 ; 0 1 0 ; 0 0 1 ; 1 0 0 ; 0 1 0 ; 0 0 1',),),
-               AlgorithmParameters=_F(INPUT_TYPE='Dict',
-                                      data=_F(FROM='String',
-                                              STRING='{ "SetSeed" : 1000 }',),),);
+                                              STRING='1 0 0 ; 0 1 0 ; 0 0 1 ; 1 0 0 ; 0 1 0 ; 0 0 1',),),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
+#CHECKSUM:102c824e97113ec0e22b72312a5fc0d0  -:FIN CHECKSUM
\ No newline at end of file
index 4349c4eedc626b5ad25f46af0ccc5e399b5e44d2..ddb46dc59aac4d3630e25e766621eb1e5b83426c 100644 (file)
@@ -4,6 +4,11 @@ study_config['StudyType'] = 'CHECKING_STUDY'
 study_config['Name'] = 'Test'
 study_config['Debug'] = '0'
 study_config['Algorithm'] = 'GradientTest'
+AlgorithmParameters_config = {} 
+AlgorithmParameters_config['Type'] = 'Dict'
+AlgorithmParameters_config['From'] = 'String'
+AlgorithmParameters_config['Data'] = '{ "SetSeed" : 1000 }'
+study_config['AlgorithmParameters'] = AlgorithmParameters_config
 CheckingPoint_config = {}
 CheckingPoint_config['Type'] = 'Vector'
 CheckingPoint_config['From'] = 'String'
@@ -24,8 +29,3 @@ outputvariables_config = {}
 outputvariables_config['Order'] = ['adao_default']
 outputvariables_config['adao_default'] = -1
 study_config['OutputVariables'] = outputvariables_config
-AlgorithmParameters_config = {} 
-AlgorithmParameters_config['Type'] = 'Dict'
-AlgorithmParameters_config['From'] = 'String'
-AlgorithmParameters_config['Data'] = '{ "SetSeed" : 1000 }'
-study_config['AlgorithmParameters'] = AlgorithmParameters_config
index af873790fb1c3aaaca05a14c4381ead4a5d217c2..35415c27c9343712697f448e8cd6c6c9b522cc02 100644 (file)
@@ -1,7 +1,9 @@
 
-CHECKING_STUDY(Study_name='Test',
-               Debug=0,
-               Algorithm='AdjointTest',
+CHECKING_STUDY(StudyName='Test',
+               AlgorithmChoices=_F(Algorithm='AdjointTest',
+                                   Parameters='Dict',
+                                   data=_F(FROM='String',
+                                           STRING='{ "SetSeed" : 1000 }',),),
                CheckingPoint=_F(Stored=0,
                                 INPUT_TYPE='Vector',
                                 data=_F(FROM='String',
@@ -9,7 +11,6 @@ CHECKING_STUDY(Study_name='Test',
                ObservationOperator=_F(Stored=0,
                                       INPUT_TYPE='Matrix',
                                       data=_F(FROM='String',
-                                              STRING='1 0 0 ; 0 1 0 ; 0 0 1 ; 1 0 0 ; 0 1 0 ; 0 0 1',),),
-               AlgorithmParameters=_F(INPUT_TYPE='Dict',
-                                      data=_F(FROM='String',
-                                              STRING='{ "SetSeed" : 1000 }',),),);
+                                              STRING='1 0 0 ; 0 1 0 ; 0 0 1 ; 1 0 0 ; 0 1 0 ; 0 0 1',),),);
+#VERSION_CATALOGUE:V7_6_0:FIN VERSION_CATALOGUE
+#CHECKSUM:4aeff874ab3d45fc7f39ed6798e33b13  -:FIN CHECKSUM
\ No newline at end of file
index 1d60dc8f23fb9f7125803bcfc5175c9567a0802c..e141f6e38b0e34b138d74a0f3f94e10a5843e8da 100644 (file)
@@ -4,6 +4,11 @@ study_config['StudyType'] = 'CHECKING_STUDY'
 study_config['Name'] = 'Test'
 study_config['Debug'] = '0'
 study_config['Algorithm'] = 'AdjointTest'
+AlgorithmParameters_config = {} 
+AlgorithmParameters_config['Type'] = 'Dict'
+AlgorithmParameters_config['From'] = 'String'
+AlgorithmParameters_config['Data'] = '{ "SetSeed" : 1000 }'
+study_config['AlgorithmParameters'] = AlgorithmParameters_config
 CheckingPoint_config = {}
 CheckingPoint_config['Type'] = 'Vector'
 CheckingPoint_config['From'] = 'String'
@@ -24,8 +29,3 @@ outputvariables_config = {}
 outputvariables_config['Order'] = ['adao_default']
 outputvariables_config['adao_default'] = -1
 study_config['OutputVariables'] = outputvariables_config
-AlgorithmParameters_config = {} 
-AlgorithmParameters_config['Type'] = 'Dict'
-AlgorithmParameters_config['From'] = 'String'
-AlgorithmParameters_config['Data'] = '{ "SetSeed" : 1000 }'
-study_config['AlgorithmParameters'] = AlgorithmParameters_config
index ba53af8ff8c920eef6a99c430925d6d6382d467f..cd3bedde270a7802419269ecaef1f3a33ab5016e 100644 (file)
@@ -101,6 +101,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             message  = "Type de simulation pour l'estimation des quantiles",
             listval  = ["Linear", "NonLinear"]
             )
+        self.defineRequiredParameter( # Pas de type
+            name     = "Bounds",
+            message  = "Liste des valeurs de bornes",
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
index 781163054b994bc1f38acb70e6d475158fe7a950..b0b4670c64ebafaec9e695322e6282d59890154b 100644 (file)
@@ -55,6 +55,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
             listval  = ["APosterioriCovariance", "BMA", "CurrentState", "CostFunctionJ", "Innovation"]
             )
+        self.defineRequiredParameter( # Pas de type
+            name     = "Bounds",
+            message  = "Liste des valeurs de bornes",
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
index c894d51363c5d000f8c18a8c08c348a86083b59d..9a934ff511149032745ff1f8b4d516bc03b5f1d8 100644 (file)
@@ -74,6 +74,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
             listval  = ["BMA", "OMA", "OMB", "CurrentState", "CostFunctionJ", "Innovation", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]
             )
+        self.defineRequiredParameter( # Pas de type
+            name     = "Bounds",
+            message  = "Liste des valeurs de bornes",
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
index 215d7d7ca26cf9f4a311011cf52d497e09f80064..c9ab24f25229675cf9d081b8cde8dc5c91b07375 100644 (file)
@@ -86,6 +86,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
             listval  = ["BMA", "OMA", "OMB", "CurrentState", "CostFunctionJ", "Innovation", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]
             )
+        self.defineRequiredParameter( # Pas de type
+            name     = "Bounds",
+            message  = "Liste des valeurs de bornes",
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
index b6a8504dbc6e07ecb224a62edda77b275e5bac50..218efb4fdb8a663515c8f80debd0ee4158697292 100644 (file)
@@ -69,6 +69,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
             listval  = ["BMA", "OMA", "OMB", "CurrentState", "CostFunctionJ", "Innovation", "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState", "SimulatedObservationAtOptimum"]
             )
+        self.defineRequiredParameter( # Pas de type
+            name     = "Bounds",
+            message  = "Liste des valeurs de bornes",
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
index 9cbd4f5f2e9c38f5737a50b71f8c7c678738ae3a..d0f95906fa71d0af706b0e3c49e864c43ddf06f4 100644 (file)
@@ -84,6 +84,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
             listval  = ["APosterioriCovariance", "BMA", "CurrentState", "CostFunctionJ", "Innovation"]
             )
+        self.defineRequiredParameter( # Pas de type
+            name     = "Bounds",
+            message  = "Liste des valeurs de bornes",
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
index 744f1ef806871961464c629b0518ce234aa3b59e..7f70e93ee2dac062c9eb36a7e28e443a91bf40a6 100644 (file)
@@ -26,11 +26,14 @@ include $(top_srcdir)/adm_local/make_common_starter.am
 mypkgpythondir =$(salomepythondir)/daEficas
 
 mypkgpython_PYTHON = \
-                    configuration_ADAO.py \
-                    convert_adao.py \
-                    generator_adao.py \
-                    __init__.py \
-                    prefs_ADAO.py \
-                    prefs.py
+               configuration_ADAO.py \
+               convert_adao.py \
+               generator_adao.py \
+               __init__.py \
+               prefs_ADAO.py \
+               prefs.py \
+               traduitADAOV7_4_0ToV7_6_0.py \
+               traduitADAOV7_5_0ToV7_6_0.py \
+               traduitADAOV7_5_1ToV7_6_0.py
 
 EXTRA_DIST = prefs_ADAO.py.in
index 3a24399b3f3ab5cc3505f0efd3cb3e7bad878194..0a321bd78841da85d48d1e35be4025c023471606 100644 (file)
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+#
 # Copyright (C) 2008-2015 EDF R&D
 #
 # This file is part of SALOME ADAO module
@@ -93,7 +94,7 @@ class AdaoGenerator(PythonGenerator):
 
   def generate_da(self):
   
-    if "__CHECKING_STUDY__Study_name" in self.dictMCVal.keys():
+    if "__CHECKING_STUDY__StudyName" in self.dictMCVal.keys():
       self.type_of_study = "CHECKING_STUDY"
     else:
       self.type_of_study = "ASSIMILATION_STUDY"
@@ -103,15 +104,20 @@ class AdaoGenerator(PythonGenerator):
 
     # Extraction de Study_type
     self.text_da += "study_config['StudyType'] = '" + self.type_of_study + "'\n"
-    # Extraction de Study_name
-    self.text_da += "study_config['Name'] = '" + self.dictMCVal["__"+self.type_of_study+"__Study_name"] + "'\n"
+    # Extraction de StudyName
+    self.text_da += "study_config['Name'] = '" + self.dictMCVal["__"+self.type_of_study+"__StudyName"] + "'\n"
     # Extraction de Debug
     if "__"+self.type_of_study+"__Debug" in self.dictMCVal.keys():
       self.text_da += "study_config['Debug'] = '" + str(self.dictMCVal["__"+self.type_of_study+"__Debug"]) + "'\n"
     else:
       self.text_da += "study_config['Debug'] = '0'\n"
-    # Extraction de Algorithm
-    self.text_da += "study_config['Algorithm'] = '" + self.dictMCVal["__"+self.type_of_study+"__Algorithm"] + "'\n"
+
+    # Extraction de Algorithm et de ses parametres
+    if "__"+self.type_of_study+"__AlgorithmChoices__Algorithm" in self.dictMCVal.keys():
+      self.text_da += "study_config['Algorithm'] = '" + self.dictMCVal["__"+self.type_of_study+"__AlgorithmChoices__Algorithm"] + "'\n"
+      self.add_AlgorithmChoices()
+    elif "__"+self.type_of_study+"__Algorithm" in self.dictMCVal.keys():
+      self.text_da += "study_config['Algorithm'] = '" + self.dictMCVal["__"+self.type_of_study+"__Algorithm"] + "'\n"
 
     if "__"+self.type_of_study+"__Background__INPUT_TYPE" in self.dictMCVal.keys():
       self.add_data("Background")
@@ -135,9 +141,9 @@ class AdaoGenerator(PythonGenerator):
     self.add_variables()
     # Parametres optionnels
 
-    # Extraction du Study_repertory
-    if "__"+self.type_of_study+"__Study_repertory" in self.dictMCVal.keys():
-      self.text_da += "study_config['Repertory'] = '" + self.dictMCVal["__"+self.type_of_study+"__Study_repertory"] + "'\n"
+    # Extraction du StudyRepertory
+    if "__"+self.type_of_study+"__StudyRepertory" in self.dictMCVal.keys():
+      self.text_da += "study_config['Repertory'] = '" + self.dictMCVal["__"+self.type_of_study+"__StudyRepertory"] + "'\n"
     # Extraction de AlgorithmParameters
     if "__"+self.type_of_study+"__AlgorithmParameters__INPUT_TYPE" in self.dictMCVal.keys():
       self.add_algorithm_parameters()
@@ -303,6 +309,47 @@ class AdaoGenerator(PythonGenerator):
     else:
       raise Exception('From Type unknown', from_type)
 
+  def add_AlgorithmChoices(self):
+
+    if not self.dictMCVal.has_key("__"+self.type_of_study+"__AlgorithmChoices__Parameters"): return
+
+    data_name = "AlgorithmParameters"
+    data_type = "Dict"
+    para_type = self.dictMCVal["__"+self.type_of_study+"__AlgorithmChoices__Parameters"]
+    if para_type == "Defaults":
+        from_type = para_type
+    elif para_type == "Dict":
+        from_type = self.dictMCVal["__"+self.type_of_study+"__AlgorithmChoices__Dict__data__FROM"]
+
+    if from_type == "Script":
+      data = self.dictMCVal["__"+self.type_of_study+"__AlgorithmChoices__Dict__data__SCRIPT_DATA__SCRIPT_FILE"]
+      self.text_da += data_name + "_config = {} \n"
+      self.text_da += data_name + "_config['Type'] = '" + data_type + "'\n"
+      self.text_da += data_name + "_config['From'] = '" + from_type + "'\n"
+      self.text_da += data_name + "_config['Data'] = '" + data + "'\n"
+      self.text_da += "study_config['" + data_name + "'] = " + data_name + "_config\n"
+    elif from_type == "String":
+      data = self.dictMCVal["__"+self.type_of_study+"__AlgorithmChoices__Dict__data__STRING_DATA__STRING"]
+      self.text_da += data_name + "_config = {} \n"
+      self.text_da += data_name + "_config['Type'] = '" + data_type + "'\n"
+      self.text_da += data_name + "_config['From'] = '" + from_type + "'\n"
+      self.text_da += data_name + "_config['Data'] = '" + data + "'\n"
+      self.text_da += "study_config['" + data_name + "'] = " + data_name + "_config\n"
+    elif from_type == "Defaults":
+      base = "__"+self.type_of_study+"__AlgorithmChoices__Parameters"
+      keys = [k for k in self.dictMCVal.keys() if base in k]
+      keys.remove(base)
+      keys = [k.replace(base,'') for k in keys]
+      data  = '{'
+      for k in keys:
+        data += '"%s":"%s",'%(k.split('__')[-1],self.dictMCVal[base+k])
+      data += '}'
+      self.text_da += data_name + "_config = {} \n"
+      self.text_da += data_name + "_config['Type'] = '" + data_type + "'\n"
+      self.text_da += data_name + "_config['From'] = '" + from_type + "'\n"
+      self.text_da += data_name + "_config['Data'] = '" + data + "'\n"
+      self.text_da += "study_config['" + data_name + "'] = " + data_name + "_config\n"
+
   def add_variables(self):
 
     # Input variables
diff --git a/src/daEficas/traduitADAOV7_4_0ToV7_6_0.py b/src/daEficas/traduitADAOV7_4_0ToV7_6_0.py
new file mode 100644 (file)
index 0000000..1c88139
--- /dev/null
@@ -0,0 +1,123 @@
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2015 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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import log
+import optparse
+import sys
+import re
+
+from load   import getJDC, getJDCFromTexte
+from mocles import parseKeywords
+from removemocle  import *
+from renamemocle  import *
+from renamemocle  import *
+from inseremocle  import *
+from changeValeur import *
+from movemocle    import *
+from dictErreurs  import *
+from regles import pasDeRegle
+
+version_out = "V7_6_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+  python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+    "ASSIMILATION_STUDY",
+    "CHECKING_STUDY",
+    )
+
+dict_erreurs = {
+    "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
+    "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
+    }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+    hdlr = log.initialise(flog)
+    if infile is not None:
+        jdc  = getJDC(infile,atraiter)
+    elif texte is not None:
+        jdc  = getJDCFromTexte(texte,atraiter)
+    else:
+        raise ValueError("Traduction du JDC impossible")
+
+    #Parse les mocles des commandes
+    parseKeywords(jdc.root)
+    GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
+    # ==========================================================================
+
+    for command in atraiter:
+        # Renomme le MC ou en insere un nouveau s'il n'existe pas ensuite
+        renameMotCle(jdc, command, "AlgorithmParameters", "AlgorithmChoices")
+        chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmChoices",((("AlgorithmChoices",),"nexistepasMCFParmi"),))
+        # Deplace le MC
+        moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmChoices")
+        # Renomme le MC
+        renameMotCleInFact(jdc, command, "AlgorithmChoices", "INPUT_TYPE", "Parameters")
+        # Renomme le MC
+        renameMotCle(jdc, command, "Study_name", "StudyName")
+        renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
+
+    # ==========================================================================
+    fsrc = jdc.getSource()
+    fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
+    fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
+    fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+    fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+    #
+    log.ferme(hdlr)
+    if outfile is not None:
+        f=open(outfile,'w')
+        f.write( fsrc )
+        f.close()
+    else:
+        return fsrc
+
+class MonTraducteur:
+    def __init__(self,texte):
+        self.__texte = str(texte)
+    def traduit(self):
+        return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+    parser = optparse.OptionParser(usage=usage)
+
+    parser.add_option('-i','--infile', dest="infile",
+        help="Le fichier COMM en entree, a traduire")
+    parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+        help="Le fichier COMM en sortie, traduit")
+
+    options, args = parser.parse_args()
+    if len(options.infile) == 0:
+        print
+        parser.print_help()
+        print
+        sys.exit(1)
+
+    traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+    main()
diff --git a/src/daEficas/traduitADAOV7_5_0ToV7_6_0.py b/src/daEficas/traduitADAOV7_5_0ToV7_6_0.py
new file mode 100644 (file)
index 0000000..1c88139
--- /dev/null
@@ -0,0 +1,123 @@
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2015 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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import log
+import optparse
+import sys
+import re
+
+from load   import getJDC, getJDCFromTexte
+from mocles import parseKeywords
+from removemocle  import *
+from renamemocle  import *
+from renamemocle  import *
+from inseremocle  import *
+from changeValeur import *
+from movemocle    import *
+from dictErreurs  import *
+from regles import pasDeRegle
+
+version_out = "V7_6_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+  python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+    "ASSIMILATION_STUDY",
+    "CHECKING_STUDY",
+    )
+
+dict_erreurs = {
+    "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
+    "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
+    }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+    hdlr = log.initialise(flog)
+    if infile is not None:
+        jdc  = getJDC(infile,atraiter)
+    elif texte is not None:
+        jdc  = getJDCFromTexte(texte,atraiter)
+    else:
+        raise ValueError("Traduction du JDC impossible")
+
+    #Parse les mocles des commandes
+    parseKeywords(jdc.root)
+    GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
+    # ==========================================================================
+
+    for command in atraiter:
+        # Renomme le MC ou en insere un nouveau s'il n'existe pas ensuite
+        renameMotCle(jdc, command, "AlgorithmParameters", "AlgorithmChoices")
+        chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmChoices",((("AlgorithmChoices",),"nexistepasMCFParmi"),))
+        # Deplace le MC
+        moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmChoices")
+        # Renomme le MC
+        renameMotCleInFact(jdc, command, "AlgorithmChoices", "INPUT_TYPE", "Parameters")
+        # Renomme le MC
+        renameMotCle(jdc, command, "Study_name", "StudyName")
+        renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
+
+    # ==========================================================================
+    fsrc = jdc.getSource()
+    fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
+    fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
+    fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+    fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+    #
+    log.ferme(hdlr)
+    if outfile is not None:
+        f=open(outfile,'w')
+        f.write( fsrc )
+        f.close()
+    else:
+        return fsrc
+
+class MonTraducteur:
+    def __init__(self,texte):
+        self.__texte = str(texte)
+    def traduit(self):
+        return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+    parser = optparse.OptionParser(usage=usage)
+
+    parser.add_option('-i','--infile', dest="infile",
+        help="Le fichier COMM en entree, a traduire")
+    parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+        help="Le fichier COMM en sortie, traduit")
+
+    options, args = parser.parse_args()
+    if len(options.infile) == 0:
+        print
+        parser.print_help()
+        print
+        sys.exit(1)
+
+    traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+    main()
diff --git a/src/daEficas/traduitADAOV7_5_1ToV7_6_0.py b/src/daEficas/traduitADAOV7_5_1ToV7_6_0.py
new file mode 100644 (file)
index 0000000..1c88139
--- /dev/null
@@ -0,0 +1,123 @@
+#-*-coding:iso-8859-1-*-
+#
+# Copyright (C) 2008-2015 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
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+import log
+import optparse
+import sys
+import re
+
+from load   import getJDC, getJDCFromTexte
+from mocles import parseKeywords
+from removemocle  import *
+from renamemocle  import *
+from renamemocle  import *
+from inseremocle  import *
+from changeValeur import *
+from movemocle    import *
+from dictErreurs  import *
+from regles import pasDeRegle
+
+version_out = "V7_6_0"
+
+usage="""Usage: python %prog [options]
+
+Typical use is:
+  python %prog --infile=xxxx.comm --outfile=yyyy.comm"""
+
+atraiter = (
+    "ASSIMILATION_STUDY",
+    "CHECKING_STUDY",
+    )
+
+dict_erreurs = {
+    "ASSIMILATION_STUDY":"Changements dans l'arbre et dans les noms",
+    "CHECKING_STUDY":"Changements dans l'arbre et dans les noms",
+    }
+
+sys.dict_erreurs=dict_erreurs
+
+def traduc(infile=None,outfile=None,texte=None,flog=None):
+    hdlr = log.initialise(flog)
+    if infile is not None:
+        jdc  = getJDC(infile,atraiter)
+    elif texte is not None:
+        jdc  = getJDCFromTexte(texte,atraiter)
+    else:
+        raise ValueError("Traduction du JDC impossible")
+
+    #Parse les mocles des commandes
+    parseKeywords(jdc.root)
+    GenereErreurPourCommande(jdc,('Algorithm','AlgorithmParameters','FunctionDict'))
+    # ==========================================================================
+
+    for command in atraiter:
+        # Renomme le MC ou en insere un nouveau s'il n'existe pas ensuite
+        renameMotCle(jdc, command, "AlgorithmParameters", "AlgorithmChoices")
+        chercheOperInsereFacteurSiRegle(jdc, command, "AlgorithmChoices",((("AlgorithmChoices",),"nexistepasMCFParmi"),))
+        # Deplace le MC
+        moveMotClefInOperToFact(jdc, command, "Algorithm", "AlgorithmChoices")
+        # Renomme le MC
+        renameMotCleInFact(jdc, command, "AlgorithmChoices", "INPUT_TYPE", "Parameters")
+        # Renomme le MC
+        renameMotCle(jdc, command, "Study_name", "StudyName")
+        renameMotCle(jdc, command, "Study_repertory", "StudyRepertory")
+
+    # ==========================================================================
+    fsrc = jdc.getSource()
+    fsrc = re.sub( "FunctionDict", "ScriptWithSwitch", fsrc )
+    fsrc = re.sub( "FUNCTIONDICT_FILE", "SCRIPTWITHSWITCH_FILE", fsrc )
+    fsrc = re.sub( "#VERSION_CATALOGUE:.*:FIN VERSION_CATALOGUE", "#VERSION_CATALOGUE:%s:FIN VERSION_CATALOGUE"%version_out, fsrc)
+    fsrc = re.sub( "#CHECKSUM.*FIN CHECKSUM", "", fsrc )
+    #
+    log.ferme(hdlr)
+    if outfile is not None:
+        f=open(outfile,'w')
+        f.write( fsrc )
+        f.close()
+    else:
+        return fsrc
+
+class MonTraducteur:
+    def __init__(self,texte):
+        self.__texte = str(texte)
+    def traduit(self):
+        return traduc(infile=None,outfile=None,texte=self.__texte,flog=None)
+
+def main():
+    parser = optparse.OptionParser(usage=usage)
+
+    parser.add_option('-i','--infile', dest="infile",
+        help="Le fichier COMM en entree, a traduire")
+    parser.add_option('-o','--outfile', dest="outfile", default='out.comm',
+        help="Le fichier COMM en sortie, traduit")
+
+    options, args = parser.parse_args()
+    if len(options.infile) == 0:
+        print
+        parser.print_help()
+        print
+        sys.exit(1)
+
+    traduc(options.infile,options.outfile)
+
+if __name__ == '__main__':
+    main()