1 #-*-coding:iso-8859-1-*-
3 # Copyright (C) 2008-2015 EDF R&D
5 # This file is part of SALOME ADAO module
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.
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.
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
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
25 # --------------------------------------------------------
26 # Generated by AdaoCatalogGenerator on 2015-06-10 11:34:00
27 # --------------------------------------------------------
36 regles = ( AU_MOINS_UN ('ASSIMILATION_STUDY','CHECKING_STUDY'), AU_PLUS_UN ('ASSIMILATION_STUDY','CHECKING_STUDY')),
38 VERSION_CATALOGUE='V7_6_0'
40 def NoCheckInNS(filename):
43 def DirectOperatorInNS(filename):
44 if os.path.exists(filename):
45 fc = open(filename, 'r').readlines()
46 cr = re.compile("^def[\s]*DirectOperator[\s]*\(")
48 if cr.match(ln): return 1
49 cr = re.compile("^DirectOperator[\s]*=")
51 if cr.match(ln): return 1
53 DirectOperatorInNS.info = u"The Python file has to contain explicitly a \"DirectOperator\" function definition with only one vector as argument."
54 def TangentOperatorInNS(filename):
55 if os.path.exists(filename):
56 fc = open(filename, 'r').readlines()
57 cr = re.compile("^def[\s]*TangentOperator[\s]*\(")
59 if cr.match(ln): return 1
60 cr = re.compile("^TangentOperator[\s]*=")
62 if cr.match(ln): return 1
64 TangentOperatorInNS.info = u"The Python file has to contain explicitly a \"TangentOperator\" function definition with only one pair of vectors as argument."
65 def AdjointOperatorInNS(filename):
66 if os.path.exists(filename):
67 fc = open(filename, 'r').readlines()
68 cr = re.compile("^def[\s]*AdjointOperator[\s]*\(")
70 if cr.match(ln): return 1
71 cr = re.compile("^AdjointOperator[\s]*=")
73 if cr.match(ln): return 1
75 AdjointOperatorInNS.info = u"The Python file has to contain explicitly an \"AdjointOperator\" function definition with only one pair of vectors as argument."
77 def F_VectorSerie(statut, fv=NoCheckInNS) : return FACT(
79 FROM = SIMP(statut = "o", typ = "TXM", into=("String", "Script", ), defaut="Script"),
80 SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
81 SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(fv)], 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"),
83 STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
84 STRING = SIMP(statut = "o", typ = "TXM", 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"),
86 SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
87 SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS), FunctionVal(TangentOperatorInNS), FunctionVal(AdjointOperatorInNS)], 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"),
89 SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
90 SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS)], 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"),
91 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"),
92 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"),
93 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"),
94 NumberOfProcesses = SIMP(statut="f", typ = "I", val_min=0, defaut=0, fr="Nombre de processus parallèles, 0 pour un contrôle automatique", ang="Number of parallel processes, 0 for automatic control"),
96 SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
97 SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')], 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"),
99 TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
100 Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
101 AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
102 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nprint 'Analysis:',xa" ),
104 AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
105 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)" ),
107 AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
108 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)" ),
113 def F_Function(statut, fv=NoCheckInNS) : return FACT(
115 FROM = SIMP(statut = "o", typ = "TXM", into=("ScriptWithOneFunction", "ScriptWithFunctions", "ScriptWithSwitch", "FunctionDict", ), defaut="ScriptWithOneFunction"),
116 SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
117 SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(fv)], 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"),
119 STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
120 STRING = SIMP(statut = "o", typ = "TXM", 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"),
122 SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
123 SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS), FunctionVal(TangentOperatorInNS), FunctionVal(AdjointOperatorInNS)], 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"),
125 SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
126 SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS)], 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"),
127 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"),
128 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"),
129 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"),
130 NumberOfProcesses = SIMP(statut="f", typ = "I", val_min=0, defaut=0, fr="Nombre de processus parallèles, 0 pour un contrôle automatique", ang="Number of parallel processes, 0 for automatic control"),
132 SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
133 SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')], 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"),
135 TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
136 Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
137 AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
138 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nprint 'Analysis:',xa" ),
140 AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
141 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)" ),
143 AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
144 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)" ),
149 def F_Matrix(statut, fv=NoCheckInNS) : return FACT(
151 FROM = SIMP(statut = "o", typ = "TXM", into=("String", "Script", ), defaut="Script"),
152 SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
153 SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(fv)], 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"),
155 STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
156 STRING = SIMP(statut = "o", typ = "TXM", 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"),
158 SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
159 SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS), FunctionVal(TangentOperatorInNS), FunctionVal(AdjointOperatorInNS)], 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"),
161 SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
162 SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS)], 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"),
163 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"),
164 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"),
165 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"),
166 NumberOfProcesses = SIMP(statut="f", typ = "I", val_min=0, defaut=0, fr="Nombre de processus parallèles, 0 pour un contrôle automatique", ang="Number of parallel processes, 0 for automatic control"),
168 SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
169 SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')], 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"),
171 TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
172 Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
173 AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
174 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nprint 'Analysis:',xa" ),
176 AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
177 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)" ),
179 AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
180 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)" ),
185 def F_DiagonalSparseMatrix(statut, fv=NoCheckInNS) : return FACT(
187 FROM = SIMP(statut = "o", typ = "TXM", into=("String", "Script", ), defaut="String"),
188 SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
189 SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(fv)], 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"),
191 STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
192 STRING = SIMP(statut = "o", typ = "TXM", 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"),
194 SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
195 SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS), FunctionVal(TangentOperatorInNS), FunctionVal(AdjointOperatorInNS)], 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"),
197 SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
198 SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS)], 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"),
199 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"),
200 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"),
201 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"),
202 NumberOfProcesses = SIMP(statut="f", typ = "I", val_min=0, defaut=0, fr="Nombre de processus parallèles, 0 pour un contrôle automatique", ang="Number of parallel processes, 0 for automatic control"),
204 SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
205 SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')], 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"),
207 TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
208 Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
209 AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
210 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nprint 'Analysis:',xa" ),
212 AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
213 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)" ),
215 AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
216 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)" ),
221 def F_Vector(statut, fv=NoCheckInNS) : return FACT(
223 FROM = SIMP(statut = "o", typ = "TXM", into=("String", "Script", ), defaut="Script"),
224 SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
225 SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(fv)], 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"),
227 STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
228 STRING = SIMP(statut = "o", typ = "TXM", 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"),
230 SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
231 SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS), FunctionVal(TangentOperatorInNS), FunctionVal(AdjointOperatorInNS)], 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"),
233 SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
234 SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS)], 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"),
235 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"),
236 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"),
237 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"),
238 NumberOfProcesses = SIMP(statut="f", typ = "I", val_min=0, defaut=0, fr="Nombre de processus parallèles, 0 pour un contrôle automatique", ang="Number of parallel processes, 0 for automatic control"),
240 SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
241 SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')], 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"),
243 TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
244 Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
245 AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
246 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nprint 'Analysis:',xa" ),
248 AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
249 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)" ),
251 AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
252 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)" ),
257 def F_Dict(statut, fv=NoCheckInNS) : return FACT(
259 FROM = SIMP(statut = "o", typ = "TXM", into=("String", "Script", ), defaut="Script"),
260 SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
261 SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(fv)], 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"),
263 STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
264 STRING = SIMP(statut = "o", typ = "TXM", 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"),
266 SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
267 SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS), FunctionVal(TangentOperatorInNS), FunctionVal(AdjointOperatorInNS)], 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"),
269 SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
270 SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS)], 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"),
271 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"),
272 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"),
273 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"),
274 NumberOfProcesses = SIMP(statut="f", typ = "I", val_min=0, defaut=0, fr="Nombre de processus parallèles, 0 pour un contrôle automatique", ang="Number of parallel processes, 0 for automatic control"),
276 SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
277 SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')], 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"),
279 TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
280 Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
281 AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
282 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nprint 'Analysis:',xa" ),
284 AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
285 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)" ),
287 AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
288 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)" ),
293 def F_ScalarSparseMatrix(statut, fv=NoCheckInNS) : return FACT(
295 FROM = SIMP(statut = "o", typ = "TXM", into=("String", "Script", ), defaut="String"),
296 SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
297 SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(fv)], 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"),
299 STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
300 STRING = SIMP(statut = "o", typ = "TXM", defaut="1.", 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"),
302 SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
303 SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS), FunctionVal(TangentOperatorInNS), FunctionVal(AdjointOperatorInNS)], 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"),
305 SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
306 SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS)], 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"),
307 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"),
308 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"),
309 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"),
310 NumberOfProcesses = SIMP(statut="f", typ = "I", val_min=0, defaut=0, fr="Nombre de processus parallèles, 0 pour un contrôle automatique", ang="Number of parallel processes, 0 for automatic control"),
312 SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
313 SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')], 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"),
315 TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
316 Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
317 AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
318 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nprint 'Analysis:',xa" ),
320 AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
321 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)" ),
323 AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
324 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)" ),
329 def ObservationErrorInNS(filename):
330 if os.path.exists(filename):
331 fc = open(filename, 'r').readlines()
332 cr = re.compile("^ObservationError[\s]*=")
334 if cr.match(ln): return 1
336 ObservationErrorInNS.info = u"The Python file has to contain explicitly a \"ObservationError\" variable."
337 def F_ObservationError(statut, fv=NoCheckInNS) : return FACT(
339 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"),
340 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Matrix", "ScalarSparseMatrix", "DiagonalSparseMatrix", ), defaut="ScalarSparseMatrix"),
341 Matrix = BLOC ( condition = " INPUT_TYPE in ( 'Matrix', ) ",
342 data = F_Matrix("o", fv),
344 ScalarSparseMatrix = BLOC ( condition = " INPUT_TYPE in ( 'ScalarSparseMatrix', ) ",
345 data = F_ScalarSparseMatrix("o", fv),
347 DiagonalSparseMatrix = BLOC ( condition = " INPUT_TYPE in ( 'DiagonalSparseMatrix', ) ",
348 data = F_DiagonalSparseMatrix("o", fv),
352 def ObservationInNS(filename):
353 if os.path.exists(filename):
354 fc = open(filename, 'r').readlines()
355 cr = re.compile("^Observation[\s]*=")
357 if cr.match(ln): return 1
359 ObservationInNS.info = u"The Python file has to contain explicitly a \"Observation\" variable."
360 def F_Observation(statut, fv=NoCheckInNS) : return FACT(
362 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"),
363 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Vector", "VectorSerie", ), defaut="Vector"),
364 Vector = BLOC ( condition = " INPUT_TYPE in ( 'Vector', ) ",
365 data = F_Vector("o", fv),
367 VectorSerie = BLOC ( condition = " INPUT_TYPE in ( 'VectorSerie', ) ",
368 data = F_VectorSerie("o", fv),
372 def BackgroundErrorInNS(filename):
373 if os.path.exists(filename):
374 fc = open(filename, 'r').readlines()
375 cr = re.compile("^BackgroundError[\s]*=")
377 if cr.match(ln): return 1
379 BackgroundErrorInNS.info = u"The Python file has to contain explicitly a \"BackgroundError\" variable."
380 def F_BackgroundError(statut, fv=NoCheckInNS) : return FACT(
382 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"),
383 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Matrix", "ScalarSparseMatrix", "DiagonalSparseMatrix", ), defaut="ScalarSparseMatrix"),
384 Matrix = BLOC ( condition = " INPUT_TYPE in ( 'Matrix', ) ",
385 data = F_Matrix("o", fv),
387 ScalarSparseMatrix = BLOC ( condition = " INPUT_TYPE in ( 'ScalarSparseMatrix', ) ",
388 data = F_ScalarSparseMatrix("o", fv),
390 DiagonalSparseMatrix = BLOC ( condition = " INPUT_TYPE in ( 'DiagonalSparseMatrix', ) ",
391 data = F_DiagonalSparseMatrix("o", fv),
395 def ObservationOperatorInNS(filename):
396 if os.path.exists(filename):
397 fc = open(filename, 'r').readlines()
398 cr = re.compile("^ObservationOperator[\s]*=")
400 if cr.match(ln): return 1
402 ObservationOperatorInNS.info = u"The Python file has to contain explicitly a \"ObservationOperator\" variable."
403 def F_ObservationOperator(statut, fv=NoCheckInNS) : return FACT(
405 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"),
406 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Matrix", "Function", ), defaut="Function"),
407 Matrix = BLOC ( condition = " INPUT_TYPE in ( 'Matrix', ) ",
408 data = F_Matrix("o", fv),
410 Function = BLOC ( condition = " INPUT_TYPE in ( 'Function', ) ",
411 data = F_Function("o", fv),
415 def CheckingPointInNS(filename):
416 if os.path.exists(filename):
417 fc = open(filename, 'r').readlines()
418 cr = re.compile("^CheckingPoint[\s]*=")
420 if cr.match(ln): return 1
422 CheckingPointInNS.info = u"The Python file has to contain explicitly a \"CheckingPoint\" variable."
423 def F_CheckingPoint(statut, fv=NoCheckInNS) : return FACT(
425 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"),
426 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Vector", ), defaut="Vector"),
427 Vector = BLOC ( condition = " INPUT_TYPE in ( 'Vector', ) ",
428 data = F_Vector("o", fv),
432 def ControlInputInNS(filename):
433 if os.path.exists(filename):
434 fc = open(filename, 'r').readlines()
435 cr = re.compile("^ControlInput[\s]*=")
437 if cr.match(ln): return 1
439 ControlInputInNS.info = u"The Python file has to contain explicitly a \"ControlInput\" variable."
440 def F_ControlInput(statut, fv=NoCheckInNS) : return FACT(
442 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"),
443 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Vector", "VectorSerie", ), defaut="Vector"),
444 Vector = BLOC ( condition = " INPUT_TYPE in ( 'Vector', ) ",
445 data = F_Vector("o", fv),
447 VectorSerie = BLOC ( condition = " INPUT_TYPE in ( 'VectorSerie', ) ",
448 data = F_VectorSerie("o", fv),
452 def BackgroundInNS(filename):
453 if os.path.exists(filename):
454 fc = open(filename, 'r').readlines()
455 cr = re.compile("^Background[\s]*=")
457 if cr.match(ln): return 1
459 BackgroundInNS.info = u"The Python file has to contain explicitly a \"Background\" variable."
460 def F_Background(statut, fv=NoCheckInNS) : return FACT(
462 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"),
463 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Vector", "VectorSerie", ), defaut="Vector"),
464 Vector = BLOC ( condition = " INPUT_TYPE in ( 'Vector', ) ",
465 data = F_Vector("o", fv),
467 VectorSerie = BLOC ( condition = " INPUT_TYPE in ( 'VectorSerie', ) ",
468 data = F_VectorSerie("o", fv),
472 def AlgorithmParametersInNS(filename):
473 if os.path.exists(filename):
474 fc = open(filename, 'r').readlines()
475 cr = re.compile("^AlgorithmParameters[\s]*=")
477 if cr.match(ln): return 1
479 AlgorithmParametersInNS.info = u"The Python file has to contain explicitly a \"AlgorithmParameters\" variable."
480 def F_AlgorithmParameters(statut, fv=NoCheckInNS) : return FACT(
483 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Dict", ), defaut="Dict"),
484 Dict = BLOC ( condition = " INPUT_TYPE in ( 'Dict', ) ",
485 data = F_Dict("o", fv),
489 def EvolutionErrorInNS(filename):
490 if os.path.exists(filename):
491 fc = open(filename, 'r').readlines()
492 cr = re.compile("^EvolutionError[\s]*=")
494 if cr.match(ln): return 1
496 EvolutionErrorInNS.info = u"The Python file has to contain explicitly a \"EvolutionError\" variable."
497 def F_EvolutionError(statut, fv=NoCheckInNS) : return FACT(
499 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"),
500 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Matrix", "ScalarSparseMatrix", "DiagonalSparseMatrix", ), defaut="ScalarSparseMatrix"),
501 Matrix = BLOC ( condition = " INPUT_TYPE in ( 'Matrix', ) ",
502 data = F_Matrix("o", fv),
504 ScalarSparseMatrix = BLOC ( condition = " INPUT_TYPE in ( 'ScalarSparseMatrix', ) ",
505 data = F_ScalarSparseMatrix("o", fv),
507 DiagonalSparseMatrix = BLOC ( condition = " INPUT_TYPE in ( 'DiagonalSparseMatrix', ) ",
508 data = F_DiagonalSparseMatrix("o", fv),
512 def UserDataInitInNS(filename):
513 if os.path.exists(filename):
514 fc = open(filename, 'r').readlines()
515 cr = re.compile("^UserDataInit[\s]*=")
517 if cr.match(ln): return 1
519 UserDataInitInNS.info = u"The Python file has to contain explicitly a \"UserDataInit\" variable."
520 def F_UserDataInit(statut, fv=NoCheckInNS) : return FACT(
523 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Dict", ), defaut="Dict"),
524 Dict = BLOC ( condition = " INPUT_TYPE in ( 'Dict', ) ",
525 data = F_Dict("o", fv),
529 def EvolutionModelInNS(filename):
530 if os.path.exists(filename):
531 fc = open(filename, 'r').readlines()
532 cr = re.compile("^EvolutionModel[\s]*=")
534 if cr.match(ln): return 1
536 EvolutionModelInNS.info = u"The Python file has to contain explicitly a \"EvolutionModel\" variable."
537 def F_EvolutionModel(statut, fv=NoCheckInNS) : return FACT(
539 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"),
540 INPUT_TYPE = SIMP(statut="o", typ = "TXM", into=("Matrix", "Function", ), defaut="Function"),
541 Matrix = BLOC ( condition = " INPUT_TYPE in ( 'Matrix', ) ",
542 data = F_Matrix("o", fv),
544 Function = BLOC ( condition = " INPUT_TYPE in ( 'Function', ) ",
545 data = F_Function("o", fv),
549 def F_UserPostAnalysis(statut, fv=NoCheckInNS) : return FACT(
551 FROM = SIMP(statut = "o", typ = "TXM", into=("String", "Script", "Template", ), defaut="Template"),
552 SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
553 SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(fv)], 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"),
555 STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
556 STRING = SIMP(statut = "o", typ = "TXM", 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"),
558 SCRIPTWITHFUNCTIONS_DATA = BLOC ( condition = " FROM in ( 'ScriptWithFunctions', ) ",
559 SCRIPTWITHFUNCTIONS_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS), FunctionVal(TangentOperatorInNS), FunctionVal(AdjointOperatorInNS)], 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"),
561 SCRIPTWITHONEFUNCTION_DATA = BLOC ( condition = " FROM in ( 'ScriptWithOneFunction', ) ",
562 SCRIPTWITHONEFUNCTION_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py'), FunctionVal(DirectOperatorInNS)], 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"),
563 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"),
564 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"),
565 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"),
566 NumberOfProcesses = SIMP(statut="f", typ = "I", val_min=0, defaut=0, fr="Nombre de processus parallèles, 0 pour un contrôle automatique", ang="Number of parallel processes, 0 for automatic control"),
568 SCRIPTWITHSWITCH_DATA = BLOC ( condition = " FROM in ( 'ScriptWithSwitch', ) ",
569 SCRIPTWITHSWITCH_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')], 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"),
571 TEMPLATE_DATA = BLOC (condition = " FROM in ( 'Template', ) ",
572 Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "AnalysisPrinter", into=("AnalysisPrinter", "AnalysisSaver", "AnalysisPrinterAndSaver")),
573 AnalysisPrinter = BLOC (condition = " Template == 'AnalysisPrinter' ",
574 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nprint 'Analysis:',xa" ),
576 AnalysisSaver = BLOC (condition = " Template == 'AnalysisSaver' ",
577 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)" ),
579 AnalysisPrinterAndSaver = BLOC (condition = " Template == 'AnalysisPrinterAndSaver' ",
580 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)" ),
585 def F_InitChoice() : return ("Background",
589 "ObservationOperator",
592 "AlgorithmParameters",
596 def F_Init(statut) : return FACT(statut = statut,
597 INIT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')]),
598 TARGET_LIST = SIMP(statut = "o", typ = "TXM", min=1, max="**", into=F_InitChoice(), validators=(VerifExiste(2))),
601 def F_ObserverTemplate() : return BLOC(condition = " NodeType == 'Template' ",
602 Template = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "ValuePrinter", into=("ValuePrinter", "ValueSeriePrinter", "ValueSaver", "ValueSerieSaver", "ValuePrinterAndSaver", "ValueSeriePrinterAndSaver", "ValueGnuPlotter", "ValueSerieGnuPlotter", "ValuePrinterAndGnuPlotter", "ValueSeriePrinterAndGnuPlotter", "ValuePrinterSaverAndGnuPlotter", "ValueSeriePrinterSaverAndGnuPlotter")),
603 ValuePrinter = BLOC (condition = " Template == 'ValuePrinter' ",
604 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info, var[-1]" ),
606 ValueSeriePrinter = BLOC (condition = " Template == 'ValueSeriePrinter' ",
607 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info, var[:] " ),
609 ValueSaver = BLOC (condition = " Template == 'ValueSaver' ",
610 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy, re\nv=numpy.array(var[-1], ndmin=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)" ),
612 ValueSerieSaver = BLOC (condition = " Template == 'ValueSerieSaver' ",
613 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy, re\nv=numpy.array(var[:], ndmin=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)" ),
615 ValuePrinterAndSaver = BLOC (condition = " Template == 'ValuePrinterAndSaver' ",
616 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy, re\nv=numpy.array(var[-1], ndmin=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)" ),
618 ValueSeriePrinterAndSaver = BLOC (condition = " Template == 'ValueSeriePrinterAndSaver' ",
619 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy, re\nv=numpy.array(var[:], ndmin=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)" ),
621 ValueGnuPlotter = BLOC (condition = " Template == 'ValueGnuPlotter' ",
622 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy, Gnuplot\nv=numpy.array(var[-1], ndmin=1)\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( v, with_='lines lw 2' ) )" ),
624 ValueSerieGnuPlotter = BLOC (condition = " Template == 'ValueSerieGnuPlotter' ",
625 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "import numpy, Gnuplot\nv=numpy.array(var[:], ndmin=1)\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( v, with_='lines lw 2' ) )" ),
627 ValuePrinterAndGnuPlotter = BLOC (condition = " Template == 'ValuePrinterAndGnuPlotter' ",
628 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info, var[-1]\nimport numpy, Gnuplot\nv=numpy.array(var[-1], ndmin=1)\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( v, with_='lines lw 2' ) )" ),
630 ValueSeriePrinterAndGnuPlotter = BLOC (condition = " Template == 'ValueSeriePrinterAndGnuPlotter' ",
631 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info, var[:] \nimport numpy, Gnuplot\nv=numpy.array(var[:], ndmin=1)\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( v, with_='lines lw 2' ) )" ),
633 ValuePrinterSaverAndGnuPlotter = BLOC (condition = " Template == 'ValuePrinterSaverAndGnuPlotter' ",
634 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info, var[-1]\nimport numpy, re\nv=numpy.array(var[-1], ndmin=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)\nimport 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( v, with_='lines lw 2' ) )" ),
636 ValueSeriePrinterSaverAndGnuPlotter = BLOC (condition = " Template == 'ValueSeriePrinterSaverAndGnuPlotter' ",
637 ValueTemplate = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "print info, var[:] \nimport numpy, re\nv=numpy.array(var[:], ndmin=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)\nimport 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( v, with_='lines lw 2' ) )" ),
641 def F_Observers(statut) : return FACT(
643 SELECTION = SIMP(statut="o", defaut=[], typ="TXM", min=0, max="**", validators=NoRepeat(), into=(['Analysis', 'Innovation', 'CurrentState', 'CurrentOptimum', 'IndexOfOptimum', 'SimulatedObservationAtBackground', 'SimulatedObservationAtCurrentState', 'SimulatedObservationAtOptimum', 'SimulatedObservationAtCurrentOptimum', 'BMA', 'OMA', 'OMB', 'CostFunctionJ', 'CostFunctionJb', 'CostFunctionJo', 'GradientOfCostFunctionJ', 'GradientOfCostFunctionJb', 'GradientOfCostFunctionJo', 'SigmaObs2', 'SigmaBck2', 'APosterioriCorrelations', 'APosterioriCovariance', 'APosterioriStandardDeviations', 'APosterioriVariances']),homo="SansOrdreNiDoublon"),
644 Analysis = BLOC (condition=" 'Analysis' in set(SELECTION) ",
645 Analysis_data = FACT(statut = "o",
646 Scheduler = SIMP(statut = "f", typ = "TXM"),
647 Info = SIMP(statut = "o", typ = "TXM", defaut = "Analysis"),
648 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
649 PythonScript = BLOC (condition = " NodeType == 'String' ",
650 Value = SIMP(statut = "o", typ = "TXM")
652 UserFile = BLOC (condition = " NodeType == 'Script' ",
653 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
655 ObserverTemplate = F_ObserverTemplate(),
658 Innovation = BLOC (condition=" 'Innovation' in set(SELECTION) ",
659 Innovation_data = FACT(statut = "o",
660 Scheduler = SIMP(statut = "f", typ = "TXM"),
661 Info = SIMP(statut = "o", typ = "TXM", defaut = "Innovation"),
662 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
663 PythonScript = BLOC (condition = " NodeType == 'String' ",
664 Value = SIMP(statut = "o", typ = "TXM")
666 UserFile = BLOC (condition = " NodeType == 'Script' ",
667 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
669 ObserverTemplate = F_ObserverTemplate(),
672 CurrentState = BLOC (condition=" 'CurrentState' in set(SELECTION) ",
673 CurrentState_data = FACT(statut = "o",
674 Scheduler = SIMP(statut = "f", typ = "TXM"),
675 Info = SIMP(statut = "o", typ = "TXM", defaut = "CurrentState"),
676 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
677 PythonScript = BLOC (condition = " NodeType == 'String' ",
678 Value = SIMP(statut = "o", typ = "TXM")
680 UserFile = BLOC (condition = " NodeType == 'Script' ",
681 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
683 ObserverTemplate = F_ObserverTemplate(),
686 CurrentOptimum = BLOC (condition=" 'CurrentOptimum' in set(SELECTION) ",
687 CurrentOptimum_data = FACT(statut = "o",
688 Scheduler = SIMP(statut = "f", typ = "TXM"),
689 Info = SIMP(statut = "o", typ = "TXM", defaut = "CurrentOptimum"),
690 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
691 PythonScript = BLOC (condition = " NodeType == 'String' ",
692 Value = SIMP(statut = "o", typ = "TXM")
694 UserFile = BLOC (condition = " NodeType == 'Script' ",
695 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
697 ObserverTemplate = F_ObserverTemplate(),
700 IndexOfOptimum = BLOC (condition=" 'IndexOfOptimum' in set(SELECTION) ",
701 IndexOfOptimum_data = FACT(statut = "o",
702 Scheduler = SIMP(statut = "f", typ = "TXM"),
703 Info = SIMP(statut = "o", typ = "TXM", defaut = "IndexOfOptimum"),
704 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
705 PythonScript = BLOC (condition = " NodeType == 'String' ",
706 Value = SIMP(statut = "o", typ = "TXM")
708 UserFile = BLOC (condition = " NodeType == 'Script' ",
709 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
711 ObserverTemplate = F_ObserverTemplate(),
714 SimulatedObservationAtBackground = BLOC (condition=" 'SimulatedObservationAtBackground' in set(SELECTION) ",
715 SimulatedObservationAtBackground_data = FACT(statut = "o",
716 Scheduler = SIMP(statut = "f", typ = "TXM"),
717 Info = SIMP(statut = "o", typ = "TXM", defaut = "SimulatedObservationAtBackground"),
718 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
719 PythonScript = BLOC (condition = " NodeType == 'String' ",
720 Value = SIMP(statut = "o", typ = "TXM")
722 UserFile = BLOC (condition = " NodeType == 'Script' ",
723 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
725 ObserverTemplate = F_ObserverTemplate(),
728 SimulatedObservationAtCurrentState = BLOC (condition=" 'SimulatedObservationAtCurrentState' in set(SELECTION) ",
729 SimulatedObservationAtCurrentState_data = FACT(statut = "o",
730 Scheduler = SIMP(statut = "f", typ = "TXM"),
731 Info = SIMP(statut = "o", typ = "TXM", defaut = "SimulatedObservationAtCurrentState"),
732 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
733 PythonScript = BLOC (condition = " NodeType == 'String' ",
734 Value = SIMP(statut = "o", typ = "TXM")
736 UserFile = BLOC (condition = " NodeType == 'Script' ",
737 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
739 ObserverTemplate = F_ObserverTemplate(),
742 SimulatedObservationAtOptimum = BLOC (condition=" 'SimulatedObservationAtOptimum' in set(SELECTION) ",
743 SimulatedObservationAtOptimum_data = FACT(statut = "o",
744 Scheduler = SIMP(statut = "f", typ = "TXM"),
745 Info = SIMP(statut = "o", typ = "TXM", defaut = "SimulatedObservationAtOptimum"),
746 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
747 PythonScript = BLOC (condition = " NodeType == 'String' ",
748 Value = SIMP(statut = "o", typ = "TXM")
750 UserFile = BLOC (condition = " NodeType == 'Script' ",
751 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
753 ObserverTemplate = F_ObserverTemplate(),
756 SimulatedObservationAtCurrentOptimum = BLOC (condition=" 'SimulatedObservationAtCurrentOptimum' in set(SELECTION) ",
757 SimulatedObservationAtCurrentOptimum_data = FACT(statut = "o",
758 Scheduler = SIMP(statut = "f", typ = "TXM"),
759 Info = SIMP(statut = "o", typ = "TXM", defaut = "SimulatedObservationAtCurrentOptimum"),
760 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
761 PythonScript = BLOC (condition = " NodeType == 'String' ",
762 Value = SIMP(statut = "o", typ = "TXM")
764 UserFile = BLOC (condition = " NodeType == 'Script' ",
765 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
767 ObserverTemplate = F_ObserverTemplate(),
770 BMA = BLOC (condition=" 'BMA' in set(SELECTION) ",
771 BMA_data = FACT(statut = "o",
772 Scheduler = SIMP(statut = "f", typ = "TXM"),
773 Info = SIMP(statut = "o", typ = "TXM", defaut = "BMA"),
774 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
775 PythonScript = BLOC (condition = " NodeType == 'String' ",
776 Value = SIMP(statut = "o", typ = "TXM")
778 UserFile = BLOC (condition = " NodeType == 'Script' ",
779 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
781 ObserverTemplate = F_ObserverTemplate(),
784 OMA = BLOC (condition=" 'OMA' in set(SELECTION) ",
785 OMA_data = FACT(statut = "o",
786 Scheduler = SIMP(statut = "f", typ = "TXM"),
787 Info = SIMP(statut = "o", typ = "TXM", defaut = "OMA"),
788 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
789 PythonScript = BLOC (condition = " NodeType == 'String' ",
790 Value = SIMP(statut = "o", typ = "TXM")
792 UserFile = BLOC (condition = " NodeType == 'Script' ",
793 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
795 ObserverTemplate = F_ObserverTemplate(),
798 OMB = BLOC (condition=" 'OMB' in set(SELECTION) ",
799 OMB_data = FACT(statut = "o",
800 Scheduler = SIMP(statut = "f", typ = "TXM"),
801 Info = SIMP(statut = "o", typ = "TXM", defaut = "OMB"),
802 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
803 PythonScript = BLOC (condition = " NodeType == 'String' ",
804 Value = SIMP(statut = "o", typ = "TXM")
806 UserFile = BLOC (condition = " NodeType == 'Script' ",
807 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
809 ObserverTemplate = F_ObserverTemplate(),
812 CostFunctionJ = BLOC (condition=" 'CostFunctionJ' in set(SELECTION) ",
813 CostFunctionJ_data = FACT(statut = "o",
814 Scheduler = SIMP(statut = "f", typ = "TXM"),
815 Info = SIMP(statut = "o", typ = "TXM", defaut = "CostFunctionJ"),
816 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
817 PythonScript = BLOC (condition = " NodeType == 'String' ",
818 Value = SIMP(statut = "o", typ = "TXM")
820 UserFile = BLOC (condition = " NodeType == 'Script' ",
821 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
823 ObserverTemplate = F_ObserverTemplate(),
826 CostFunctionJb = BLOC (condition=" 'CostFunctionJb' in set(SELECTION) ",
827 CostFunctionJb_data = FACT(statut = "o",
828 Scheduler = SIMP(statut = "f", typ = "TXM"),
829 Info = SIMP(statut = "o", typ = "TXM", defaut = "CostFunctionJb"),
830 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
831 PythonScript = BLOC (condition = " NodeType == 'String' ",
832 Value = SIMP(statut = "o", typ = "TXM")
834 UserFile = BLOC (condition = " NodeType == 'Script' ",
835 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
837 ObserverTemplate = F_ObserverTemplate(),
840 CostFunctionJo = BLOC (condition=" 'CostFunctionJo' in set(SELECTION) ",
841 CostFunctionJo_data = FACT(statut = "o",
842 Scheduler = SIMP(statut = "f", typ = "TXM"),
843 Info = SIMP(statut = "o", typ = "TXM", defaut = "CostFunctionJo"),
844 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
845 PythonScript = BLOC (condition = " NodeType == 'String' ",
846 Value = SIMP(statut = "o", typ = "TXM")
848 UserFile = BLOC (condition = " NodeType == 'Script' ",
849 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
851 ObserverTemplate = F_ObserverTemplate(),
854 GradientOfCostFunctionJ = BLOC (condition=" 'GradientOfCostFunctionJ' in set(SELECTION) ",
855 GradientOfCostFunctionJ_data = FACT(statut = "o",
856 Scheduler = SIMP(statut = "f", typ = "TXM"),
857 Info = SIMP(statut = "o", typ = "TXM", defaut = "GradientOfCostFunctionJ"),
858 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
859 PythonScript = BLOC (condition = " NodeType == 'String' ",
860 Value = SIMP(statut = "o", typ = "TXM")
862 UserFile = BLOC (condition = " NodeType == 'Script' ",
863 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
865 ObserverTemplate = F_ObserverTemplate(),
868 GradientOfCostFunctionJb = BLOC (condition=" 'GradientOfCostFunctionJb' in set(SELECTION) ",
869 GradientOfCostFunctionJb_data = FACT(statut = "o",
870 Scheduler = SIMP(statut = "f", typ = "TXM"),
871 Info = SIMP(statut = "o", typ = "TXM", defaut = "GradientOfCostFunctionJb"),
872 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
873 PythonScript = BLOC (condition = " NodeType == 'String' ",
874 Value = SIMP(statut = "o", typ = "TXM")
876 UserFile = BLOC (condition = " NodeType == 'Script' ",
877 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
879 ObserverTemplate = F_ObserverTemplate(),
882 GradientOfCostFunctionJo = BLOC (condition=" 'GradientOfCostFunctionJo' in set(SELECTION) ",
883 GradientOfCostFunctionJo_data = FACT(statut = "o",
884 Scheduler = SIMP(statut = "f", typ = "TXM"),
885 Info = SIMP(statut = "o", typ = "TXM", defaut = "GradientOfCostFunctionJo"),
886 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
887 PythonScript = BLOC (condition = " NodeType == 'String' ",
888 Value = SIMP(statut = "o", typ = "TXM")
890 UserFile = BLOC (condition = " NodeType == 'Script' ",
891 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
893 ObserverTemplate = F_ObserverTemplate(),
896 SigmaObs2 = BLOC (condition=" 'SigmaObs2' in set(SELECTION) ",
897 SigmaObs2_data = FACT(statut = "o",
898 Scheduler = SIMP(statut = "f", typ = "TXM"),
899 Info = SIMP(statut = "o", typ = "TXM", defaut = "SigmaObs2"),
900 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
901 PythonScript = BLOC (condition = " NodeType == 'String' ",
902 Value = SIMP(statut = "o", typ = "TXM")
904 UserFile = BLOC (condition = " NodeType == 'Script' ",
905 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
907 ObserverTemplate = F_ObserverTemplate(),
910 SigmaBck2 = BLOC (condition=" 'SigmaBck2' in set(SELECTION) ",
911 SigmaBck2_data = FACT(statut = "o",
912 Scheduler = SIMP(statut = "f", typ = "TXM"),
913 Info = SIMP(statut = "o", typ = "TXM", defaut = "SigmaBck2"),
914 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
915 PythonScript = BLOC (condition = " NodeType == 'String' ",
916 Value = SIMP(statut = "o", typ = "TXM")
918 UserFile = BLOC (condition = " NodeType == 'Script' ",
919 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
921 ObserverTemplate = F_ObserverTemplate(),
924 APosterioriCorrelations = BLOC (condition=" 'APosterioriCorrelations' in set(SELECTION) ",
925 APosterioriCorrelations_data = FACT(statut = "o",
926 Scheduler = SIMP(statut = "f", typ = "TXM"),
927 Info = SIMP(statut = "o", typ = "TXM", defaut = "APosterioriCorrelations"),
928 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
929 PythonScript = BLOC (condition = " NodeType == 'String' ",
930 Value = SIMP(statut = "o", typ = "TXM")
932 UserFile = BLOC (condition = " NodeType == 'Script' ",
933 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
935 ObserverTemplate = F_ObserverTemplate(),
938 APosterioriCovariance = BLOC (condition=" 'APosterioriCovariance' in set(SELECTION) ",
939 APosterioriCovariance_data = FACT(statut = "o",
940 Scheduler = SIMP(statut = "f", typ = "TXM"),
941 Info = SIMP(statut = "o", typ = "TXM", defaut = "APosterioriCovariance"),
942 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
943 PythonScript = BLOC (condition = " NodeType == 'String' ",
944 Value = SIMP(statut = "o", typ = "TXM")
946 UserFile = BLOC (condition = " NodeType == 'Script' ",
947 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
949 ObserverTemplate = F_ObserverTemplate(),
952 APosterioriStandardDeviations = BLOC (condition=" 'APosterioriStandardDeviations' in set(SELECTION) ",
953 APosterioriStandardDeviations_data = FACT(statut = "o",
954 Scheduler = SIMP(statut = "f", typ = "TXM"),
955 Info = SIMP(statut = "o", typ = "TXM", defaut = "APosterioriStandardDeviations"),
956 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
957 PythonScript = BLOC (condition = " NodeType == 'String' ",
958 Value = SIMP(statut = "o", typ = "TXM")
960 UserFile = BLOC (condition = " NodeType == 'Script' ",
961 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
963 ObserverTemplate = F_ObserverTemplate(),
966 APosterioriVariances = BLOC (condition=" 'APosterioriVariances' in set(SELECTION) ",
967 APosterioriVariances_data = FACT(statut = "o",
968 Scheduler = SIMP(statut = "f", typ = "TXM"),
969 Info = SIMP(statut = "o", typ = "TXM", defaut = "APosterioriVariances"),
970 NodeType = SIMP(statut = "o", typ = "TXM", min=1, max=1, defaut = "Template", into=("String", "Script", "Template")),
971 PythonScript = BLOC (condition = " NodeType == 'String' ",
972 Value = SIMP(statut = "o", typ = "TXM")
974 UserFile = BLOC (condition = " NodeType == 'Script' ",
975 Value = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), FileExtVal('py')])
977 ObserverTemplate = F_ObserverTemplate(),
982 def AlgorithmParametersInNS(filename):
983 if os.path.exists(filename):
984 fc = open(filename, 'r').readlines()
985 cr = re.compile("^AlgorithmParameters[\s]*=")
987 if cr.match(ln): return 1
989 AlgorithmParametersInNS.info = u"The Python file has to contain explicitly an \"AlgorithmParameters\" variable."
990 def F_AlgorithmParameters(statut, algos_names, fv=NoCheckInNS) : return FACT(
992 Algorithm = SIMP(statut="o", typ = "TXM", into = algos_names ),
993 Parameters = SIMP(statut="f", typ = "TXM", into=("Defaults", "Dict") ),
994 Dict = BLOC ( condition = " Parameters == 'Dict' ",
996 data = F_Dict("o", fv),
998 Parameters3DVAR = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == '3DVAR') ",
1000 Bounds = SIMP(statut="f", typ="TXM", fr="Liste des valeurs de bornes"),
1001 CostDecrementTolerance = SIMP(statut="f", typ="R", min=1, max=1, defaut=1e-07, fr="Diminution relative minimale du cout lors de l'arrêt"),
1002 GradientNormTolerance = SIMP(statut="f", typ="R", min=1, max=1, defaut=1e-05, fr="Maximum des composantes du gradient lors de l'arrêt"),
1003 MaximumNumberOfSteps = SIMP(statut="f", typ="I", val_min=-1, min=1, max=1, defaut=15000, fr="Nombre maximal de pas d'optimisation"),
1004 Minimizer = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="LBFGSB", into=['LBFGSB', 'TNC', 'CG', 'NCG', 'BFGS'], fr="Minimiseur utilisé"),
1005 NumberOfSamplesForQuantiles = SIMP(statut="f", typ="I", val_min=1, min=1, max=1, defaut=100, fr="Nombre d'échantillons simulés pour le calcul des quantiles"),
1006 ProjectedGradientTolerance = SIMP(statut="f", typ="R", val_min=-1, min=1, max=1, defaut=-1.0, fr="Maximum des composantes du gradient projeté lors de l'arrêt"),
1007 Quantiles = SIMP(statut="f", typ="TXM", max="**", into=None, fr="Liste des valeurs de quantiles"),
1008 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1009 SimulationForQuantiles = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="Linear", into=['Linear', 'NonLinear'], fr="Type de simulation pour l'estimation des quantiles"),
1010 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['APosterioriCorrelations', 'APosterioriCovariance', 'APosterioriStandardDeviations', 'APosterioriVariances', 'BMA', 'OMA', 'OMB', 'CurrentState', 'CostFunctionJ', 'CurrentOptimum', 'IndexOfOptimum', 'Innovation', 'SigmaObs2', 'MahalanobisConsistency', 'SimulationQuantiles', 'SimulatedObservationAtBackground', 'SimulatedObservationAtCurrentState', 'SimulatedObservationAtOptimum', 'SimulatedObservationAtCurrentOptimum'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1012 ParametersBlue = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'Blue') ",
1014 NumberOfSamplesForQuantiles = SIMP(statut="f", typ="I", val_min=1, min=1, max=1, defaut=100, fr="Nombre d'échantillons simulés pour le calcul des quantiles"),
1015 Quantiles = SIMP(statut="f", typ="TXM", max="**", into=None, fr="Liste des valeurs de quantiles"),
1016 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1017 SimulationForQuantiles = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="Linear", into=['Linear', 'NonLinear'], fr="Type de simulation pour l'estimation des quantiles"),
1018 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['APosterioriCorrelations', 'APosterioriCovariance', 'APosterioriStandardDeviations', 'APosterioriVariances', 'BMA', 'OMA', 'OMB', 'CurrentState', 'CostFunctionJ', 'Innovation', 'SigmaBck2', 'SigmaObs2', 'MahalanobisConsistency', 'SimulationQuantiles', 'SimulatedObservationAtBackground', 'SimulatedObservationAtCurrentState', 'SimulatedObservationAtOptimum'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1020 ParametersEnsembleBlue = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'EnsembleBlue') ",
1022 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1023 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['CurrentState', 'Innovation', 'SimulatedObservationAtBackground', 'SimulatedObservationAtCurrentState', 'SimulatedObservationAtOptimum'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1025 ParametersExtendedBlue = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'ExtendedBlue') ",
1027 NumberOfSamplesForQuantiles = SIMP(statut="f", typ="I", val_min=1, min=1, max=1, defaut=100, fr="Nombre d'échantillons simulés pour le calcul des quantiles"),
1028 Quantiles = SIMP(statut="f", typ="TXM", max="**", into=None, fr="Liste des valeurs de quantiles"),
1029 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1030 SimulationForQuantiles = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="Linear", into=['Linear', 'NonLinear'], fr="Type de simulation pour l'estimation des quantiles"),
1031 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['APosterioriCorrelations', 'APosterioriCovariance', 'APosterioriStandardDeviations', 'APosterioriVariances', 'BMA', 'OMA', 'OMB', 'CurrentState', 'CostFunctionJ', 'Innovation', 'SigmaBck2', 'SigmaObs2', 'MahalanobisConsistency', 'SimulationQuantiles', 'SimulatedObservationAtBackground', 'SimulatedObservationAtCurrentState', 'SimulatedObservationAtOptimum'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1033 ParametersExtendedKalmanFilter = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'ExtendedKalmanFilter') ",
1035 Bounds = SIMP(statut="f", typ="TXM", fr="Liste des valeurs de bornes"),
1036 ConstrainedBy = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="EstimateProjection", into=['EstimateProjection'], fr="Prise en compte des contraintes"),
1037 EstimationOf = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="State", into=['State', 'Parameters'], fr="Estimation d'etat ou de parametres"),
1038 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['APosterioriCorrelations', 'APosterioriCovariance', 'APosterioriStandardDeviations', 'APosterioriVariances', 'BMA', 'CurrentState', 'CostFunctionJ', 'Innovation'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1040 ParametersKalmanFilter = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'KalmanFilter') ",
1042 EstimationOf = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="State", into=['State', 'Parameters'], fr="Estimation d'etat ou de parametres"),
1043 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['APosterioriCorrelations', 'APosterioriCovariance', 'APosterioriStandardDeviations', 'APosterioriVariances', 'BMA', 'CurrentState', 'CostFunctionJ', 'Innovation'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1045 ParametersLinearLeastSquares = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'LinearLeastSquares') ",
1047 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['OMA', 'CurrentState', 'CostFunctionJ', 'SimulatedObservationAtCurrentState', 'SimulatedObservationAtOptimum'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1049 ParametersNonLinearLeastSquares = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'NonLinearLeastSquares') ",
1051 Bounds = SIMP(statut="f", typ="TXM", fr="Liste des valeurs de bornes"),
1052 CostDecrementTolerance = SIMP(statut="f", typ="R", min=1, max=1, defaut=1e-07, fr="Diminution relative minimale du cout lors de l'arrêt"),
1053 GradientNormTolerance = SIMP(statut="f", typ="R", min=1, max=1, defaut=1e-05, fr="Maximum des composantes du gradient lors de l'arrêt"),
1054 MaximumNumberOfSteps = SIMP(statut="f", typ="I", val_min=-1, min=1, max=1, defaut=15000, fr="Nombre maximal de pas d'optimisation"),
1055 Minimizer = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="LBFGSB", into=['LBFGSB', 'TNC', 'CG', 'NCG', 'BFGS', 'LM'], fr="Minimiseur utilisé"),
1056 ProjectedGradientTolerance = SIMP(statut="f", typ="R", val_min=-1, min=1, max=1, defaut=-1.0, fr="Maximum des composantes du gradient projeté lors de l'arrêt"),
1057 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['BMA', 'OMA', 'OMB', 'CurrentState', 'CostFunctionJ', 'Innovation', 'SimulatedObservationAtCurrentState', 'SimulatedObservationAtOptimum'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1059 ParametersParticleSwarmOptimization = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'ParticleSwarmOptimization') ",
1061 BoxBounds = SIMP(statut="f", typ="TXM", fr="Liste des valeurs de bornes d'incréments de paramètres"),
1062 GroupRecallRate = SIMP(statut="f", typ="R", val_min=0.0, val_max=1.0, min=1, max=1, defaut=0.5, fr="Taux de rappel au meilleur insecte du groupe (entre 0 et 1)"),
1063 MaximumNumberOfSteps = SIMP(statut="f", typ="I", val_min=1, min=1, max=1, defaut=50, fr="Nombre maximal de pas d'optimisation"),
1064 NumberOfInsects = SIMP(statut="f", typ="I", val_min=-1, min=1, max=1, defaut=100, fr="Nombre d'insectes dans l'essaim"),
1065 QualityCriterion = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="AugmentedWeightedLeastSquares", into=['AugmentedWeightedLeastSquares', 'AWLS', 'AugmentedPonderatedLeastSquares', 'APLS', 'DA', 'WeightedLeastSquares', 'WLS', 'PonderatedLeastSquares', 'PLS', 'LeastSquares', 'LS', 'L2', 'AbsoluteValue', 'L1', 'MaximumError', 'ME'], fr="Critère de qualité utilisé"),
1066 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1067 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['BMA', 'OMA', 'OMB', 'CurrentState', 'CostFunctionJ', 'Innovation', 'SimulatedObservationAtBackground', 'SimulatedObservationAtCurrentState', 'SimulatedObservationAtOptimum'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1068 SwarmVelocity = SIMP(statut="f", typ="R", val_min=0.0, min=1, max=1, defaut=1.0, fr="Vitesse de groupe imposée par l'essaim"),
1070 ParametersQuantileRegression = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'QuantileRegression') ",
1072 Bounds = SIMP(statut="f", typ="TXM", fr="Liste des valeurs de bornes"),
1073 CostDecrementTolerance = SIMP(statut="f", typ="R", min=1, max=1, defaut=1e-06, fr="Maximum de variation de la fonction d'estimation lors de l'arrêt"),
1074 MaximumNumberOfSteps = SIMP(statut="f", typ="I", val_min=1, min=1, max=1, defaut=15000, fr="Nombre maximal de pas d'optimisation"),
1075 Minimizer = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="MMQR", into=['MMQR'], fr="Minimiseur utilisé"),
1076 Quantile = SIMP(statut="f", typ="R", val_min=0.0, val_max=1.0, min=1, max=1, defaut=0.5, fr="Quantile pour la regression de quantile"),
1077 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['BMA', 'OMA', 'OMB', 'CurrentState', 'CostFunctionJ', 'Innovation', 'SimulatedObservationAtBackground', 'SimulatedObservationAtCurrentState', 'SimulatedObservationAtOptimum'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1079 ParametersUnscentedKalmanFilter = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'UnscentedKalmanFilter') ",
1081 Alpha = SIMP(statut="f", typ="R", val_min=0.0001, val_max=1.0, min=1, max=1, defaut=1.0, fr=""),
1082 Beta = SIMP(statut="f", typ="R", min=1, max=1, defaut=2.0, fr=""),
1083 Bounds = SIMP(statut="f", typ="TXM", fr="Liste des valeurs de bornes"),
1084 ConstrainedBy = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="EstimateProjection", into=['EstimateProjection'], fr="Prise en compte des contraintes"),
1085 EstimationOf = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="State", into=['State', 'Parameters'], fr="Estimation d'etat ou de parametres"),
1086 Kappa = SIMP(statut="f", typ="I", val_max=2, min=1, max=1, defaut=0, fr=""),
1087 Reconditioner = SIMP(statut="f", typ="R", val_min=0.001, val_max=10.0, min=1, max=1, defaut=1.0, fr=""),
1088 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['APosterioriCorrelations', 'APosterioriCovariance', 'APosterioriStandardDeviations', 'APosterioriVariances', 'BMA', 'CurrentState', 'CostFunctionJ', 'Innovation'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1090 ParametersAdjointTest = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'AdjointTest') ",
1092 AmplitudeOfInitialDirection = SIMP(statut="f", typ="R", min=1, max=1, defaut=1.0, fr="Amplitude de la direction initiale de la dérivée directionnelle autour du point nominal"),
1093 EpsilonMinimumExponent = SIMP(statut="f", typ="I", val_min=-20, val_max=0, min=1, max=1, defaut=-8, fr="Exposant minimal en puissance de 10 pour le multiplicateur d'incrément"),
1094 InitialDirection = SIMP(statut="f", typ="TXM", fr="Direction initiale de la dérivée directionnelle autour du point nominal"),
1095 ResiduFormula = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="ScalarProduct", into=['ScalarProduct'], fr="Formule de résidu utilisée"),
1096 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1098 ParametersFunctionTest = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'FunctionTest') ",
1100 NumberOfPrintedDigits = SIMP(statut="f", typ="I", val_min=0, min=1, max=1, defaut=5, fr="Nombre de chiffres affichés pour les impressions de réels"),
1101 NumberOfRepetition = SIMP(statut="f", typ="I", val_min=1, min=1, max=1, defaut=1, fr="Nombre de fois où l'exécution de la fonction est répétée"),
1102 SetDebug = SIMP(statut="f", typ="I", min=1, max=1, defaut=0, fr="Activation du mode debug lors de l'exécution"),
1104 ParametersGradientTest = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'GradientTest') ",
1106 AmplitudeOfInitialDirection = SIMP(statut="f", typ="R", min=1, max=1, defaut=1.0, fr="Amplitude de la direction initiale de la dérivée directionnelle autour du point nominal"),
1107 AmplitudeOfTangentPerturbation = SIMP(statut="f", typ="R", val_min=1e-10, val_max=1.0, min=1, max=1, defaut=0.01, fr="Amplitude de la perturbation pour le calcul de la forme tangente"),
1108 EpsilonMinimumExponent = SIMP(statut="f", typ="I", val_min=-20, val_max=0, min=1, max=1, defaut=-8, fr="Exposant minimal en puissance de 10 pour le multiplicateur d'incrément"),
1109 InitialDirection = SIMP(statut="f", typ="TXM", fr="Direction initiale de la dérivée directionnelle autour du point nominal"),
1110 ResiduFormula = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="Taylor", into=['Norm', 'TaylorOnNorm', 'Taylor'], fr="Formule de résidu utilisée"),
1111 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1113 ParametersLinearityTest = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'LinearityTest') ",
1115 AmplitudeOfInitialDirection = SIMP(statut="f", typ="R", min=1, max=1, defaut=1.0, fr="Amplitude de la direction initiale de la dérivée directionnelle autour du point nominal"),
1116 AmplitudeOfTangentPerturbation = SIMP(statut="f", typ="R", val_min=1e-10, val_max=1.0, min=1, max=1, defaut=0.01, fr="Amplitude de la perturbation pour le calcul de la forme tangente"),
1117 EpsilonMinimumExponent = SIMP(statut="f", typ="I", val_min=-20, val_max=0, min=1, max=1, defaut=-8, fr="Exposant minimal en puissance de 10 pour le multiplicateur d'incrément"),
1118 InitialDirection = SIMP(statut="f", typ="TXM", fr="Direction initiale de la dérivée directionnelle autour du point nominal"),
1119 ResiduFormula = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="CenteredDL", into=['CenteredDL', 'Taylor', 'NominalTaylor', 'NominalTaylorRMS'], fr="Formule de résidu utilisée"),
1120 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1122 ParametersSamplingTest = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'SamplingTest') ",
1124 QualityCriterion = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="AugmentedWeightedLeastSquares", into=['AugmentedWeightedLeastSquares', 'AWLS', 'AugmentedPonderatedLeastSquares', 'APLS', 'DA', 'WeightedLeastSquares', 'WLS', 'PonderatedLeastSquares', 'PLS', 'LeastSquares', 'LS', 'L2', 'AbsoluteValue', 'L1', 'MaximumError', 'ME'], fr="Critère de qualité utilisé"),
1125 SampleAsExplicitHyperCube = SIMP(statut="f", typ="TXM", max="**", into=None, fr="Points de calcul définis par un hyper-cube dont on donne la liste des échantillonages de chaque variable comme une liste"),
1126 SampleAsIndependantRandomVariables = SIMP(statut="f", typ="TXM", max="**", into=None, fr="Points de calcul définis par un hyper-cube dont les points sur chaque axe proviennent de l'échantillonage indépendant de la variable selon la spécification ['distribution',[parametres],nombre]"),
1127 SampleAsMinMaxStepHyperCube = SIMP(statut="f", typ="TXM", max="**", into=None, fr="Points de calcul définis par un hyper-cube dont on donne la liste des échantillonages de chaque variable par un triplet [min,max,step]"),
1128 SampleAsnUplet = SIMP(statut="f", typ="TXM", max="**", into=None, fr="Points de calcul définis par une liste de n-uplet"),
1129 SetDebug = SIMP(statut="f", typ="I", min=1, max=1, defaut=0, fr="Activation du mode debug lors de l'exécution"),
1130 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1131 StoreSupplementaryCalculations = SIMP(statut="f", typ="TXM", max="**", into=['CostFunctionJ', 'CurrentState', 'Innovation', 'SimulatedObservationAtCurrentState'], fr="Liste de calculs supplémentaires à stocker et/ou effectuer"),
1133 ParametersTangentTest = BLOC (condition = " (Parameters == 'Defaults') and (Algorithm == 'TangentTest') ",
1135 AmplitudeOfInitialDirection = SIMP(statut="f", typ="R", min=1, max=1, defaut=1.0, fr="Amplitude de la direction initiale de la dérivée directionnelle autour du point nominal"),
1136 AmplitudeOfTangentPerturbation = SIMP(statut="f", typ="R", val_min=1e-10, val_max=1.0, min=1, max=1, defaut=0.01, fr="Amplitude de la perturbation pour le calcul de la forme tangente"),
1137 EpsilonMinimumExponent = SIMP(statut="f", typ="I", val_min=-20, val_max=0, min=1, max=1, defaut=-8, fr="Exposant minimal en puissance de 10 pour le multiplicateur d'incrément"),
1138 InitialDirection = SIMP(statut="f", typ="TXM", fr="Direction initiale de la dérivée directionnelle autour du point nominal"),
1139 ResiduFormula = SIMP(statut="f", typ="TXM", min=1, max=1, defaut="Taylor", into=['Taylor'], fr="Formule de résidu utilisée"),
1140 SetSeed = SIMP(statut="f", typ="TXM", fr="Graine fixée pour le générateur aléatoire"),
1144 def F_variables(statut) : return FACT(
1146 regles = ( MEME_NOMBRE ('NAMES', 'SIZES')),
1147 NAMES = SIMP(statut="o", typ="TXM", max="**", validators=NoRepeat()),
1148 SIZES = SIMP(statut="o", typ="I", val_min=1, max="**")
1151 os.chdir(os.path.abspath(dirname))
1153 ChDir.info = u"This has to be a regular directory path."
1155 ASSIMILATION_STUDY = PROC(nom="ASSIMILATION_STUDY",
1158 StudyName = SIMP(statut="o", typ = "TXM", defaut="ADAO Calculation Case"),
1159 StudyRepertory = SIMP(statut="f", typ = "Repertoire", validators=FunctionVal(ChDir), min=1, max=1),
1160 Debug = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0),
1161 AlgorithmParameters = F_AlgorithmParameters("o",("3DVAR", "Blue", "EnsembleBlue", "ExtendedBlue", "ExtendedKalmanFilter", "KalmanFilter", "LinearLeastSquares", "NonLinearLeastSquares", "ParticleSwarmOptimization", "QuantileRegression", "UnscentedKalmanFilter", ), AlgorithmParametersInNS),
1162 Background = F_Background("o", BackgroundInNS),
1163 BackgroundError = F_BackgroundError("o", BackgroundErrorInNS),
1164 Observation = F_Observation("o", ObservationInNS),
1165 ObservationError = F_ObservationError("o", ObservationErrorInNS),
1166 ObservationOperator = F_ObservationOperator("o"),
1167 EvolutionModel = F_EvolutionModel("f"),
1168 EvolutionError = F_EvolutionError("f", EvolutionErrorInNS),
1169 ControlInput = F_ControlInput("f"),
1170 UserDataInit = F_Init("f"),
1171 UserPostAnalysis = F_UserPostAnalysis("o"),
1172 InputVariables = F_variables("f"),
1173 OutputVariables = F_variables("f"),
1174 Observers = F_Observers("f")
1177 CHECKING_STUDY = PROC(nom="CHECKING_STUDY",
1180 StudyName = SIMP(statut="o", typ = "TXM", defaut="ADAO Checking Case"),
1181 StudyRepertory = SIMP(statut="f", typ = "Repertoire", validators=FunctionVal(ChDir), min=1, max=1),
1182 Debug = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0),
1183 AlgorithmParameters = F_AlgorithmParameters("o", ("AdjointTest", "FunctionTest", "GradientTest", "LinearityTest", "ObserverTest", "SamplingTest", "TangentTest", ), AlgorithmParametersInNS),
1184 CheckingPoint = F_CheckingPoint("o", CheckingPointInNS),
1185 BackgroundError = F_BackgroundError("f", BackgroundErrorInNS),
1186 Observation = F_Observation("f", ObservationInNS),
1187 ObservationError = F_ObservationError("f", ObservationErrorInNS),
1188 ObservationOperator = F_ObservationOperator("o"),
1189 UserDataInit = F_Init("f"),
1190 Observers = F_Observers("f")