Salome HOME
Improvement and extension of EnKF algorithm (loc)
[modules/adao.git] / bin / AdaoCatalogGenerator.py
index ef5d30daac62d78e9597d68375e366bed1f6721f..ec0a494092916ba411ade79286d31426cf2acf58 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2008-2019 EDF R&D
+# Copyright (C) 2008-2020 EDF R&D
 #
 # This file is part of SALOME ADAO module
 #
@@ -52,7 +52,7 @@ except:
 #----------- Templates Part ---------------#
 begin_catalog_file = """# -*- coding: utf-8 -*-
 #
-# Copyright (C) 2008-2019 EDF R&D
+# Copyright (C) 2008-2020 EDF R&D
 #
 # This file is part of SALOME ADAO module
 #
@@ -125,6 +125,12 @@ def AdjointOperatorInNS(filename):
             if cr.match(ln): return 1
     return 0
 AdjointOperatorInNS.info = u"The Python file has to contain explicitly an \\"AdjointOperator\\" function definition with only one pair of vectors as argument."
+def ColDataFileExtVal(filename):
+    __readable = (".csv", ".tsv", ".txt", ".npy", ".npz")
+    if os.path.exists(filename) and os.path.splitext(filename)[1] in __readable:
+        return 1
+    return 0
+ColDataFileExtVal.info = u"The data file has to contain explicitly one or more number columns with separator, or one variable, that can fit in a unique continuous vector."
 """%(module_version.name,module_version.cata)
 
 # Important : validators=[...] pour que les conditions soient traitees simultanement, en "ET", et pas en "OU" (choisi dans le cas du tuple a la place de la liste)
@@ -134,7 +140,11 @@ def F_{data_name}(statut, fv=NoCheckInNS) : return FACT(
     statut = statut,
     FROM = SIMP(statut = "o", typ = "TXM", into=({data_into}), defaut={data_default}),
     SCRIPT_DATA = BLOC ( condition = " FROM in ( 'Script', ) ",
-        SCRIPT_FILE = SIMP(statut = "o", typ = "FichierNoAbs", validators=[OnlyStr(), 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"),
+        SCRIPT_FILE = SIMP(statut = "o", typ = ("FichierNoAbs",'Python Files (*.py)',), 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"),
+        ),
+    DATA_DATA = BLOC ( condition = " FROM in ( 'DataFile', ) ",
+        DATA_FILE = SIMP(statut = "o", typ = ("FichierNoAbs",'CSV Text Files (*.csv);;TSV Text Files (*.tsv);;TXT Text Files (*.txt);;NPY Binary Numpy Files (*.npy);;NPZ Binary Numpy Files (*.npz);;All Files (*)", ',), validators=[OnlyStr(), FunctionVal(ColDataFileExtVal)], fr="En attente d'un nom de fichier de données, avec ou sans le chemin complet pour le trouver, contenant ou plusieurs colonnes pour définir un unique vecteur continu", ang="Waiting for a data file name, with or without the full path to find it, containing one or more columns to define a unique continuous vector"),
+        ColMajor = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0, fr="Variables en colonnes acquises ligne par ligne (0) ou colonne par colonne (1)", ang="Variables in columns acquired line by line (0) or column by column (1)"),
         ),
     STRING_DATA = BLOC ( condition = " FROM in ( 'String', ) ",
         STRING = SIMP(statut = "o", typ = "TXM",{ms_default} fr="En attente d'une chaine de caractères entre guillements. Pour construire un vecteur ou une matrice, ce doit être une suite de nombres, utilisant un espace ou une virgule pour séparer deux éléments et un point-virgule pour séparer deux lignes", ang="Waiting for a string in quotes. To build a vector or a matrix, it has to be a float serie, using a space or comma to separate two elements in a line, a semi-colon to separate rows"),
@@ -287,6 +297,7 @@ ASSIMILATION_STUDY = PROC(nom="ASSIMILATION_STUDY",
     StudyName           = SIMP(statut="o", typ = "TXM", defaut="ADAO Calculation Case"),
     StudyRepertory      = SIMP(statut="f", typ = "Repertoire", validators=FunctionVal(ChDir), min=1, max=1),
     Debug               = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0),
+    ExecuteInContainer  = SIMP(statut="f", typ = "TXM", min=1, max=1, defaut = "No", into=("No", "Mono", "Multi")),
     AlgorithmParameters = F_AlgorithmParameters("o",({algos_names}), AlgorithmParametersInNS),
     Background          = F_Background("o", BackgroundInNS),
     BackgroundError     = F_BackgroundError("o", BackgroundErrorInNS),
@@ -309,8 +320,10 @@ CHECKING_STUDY = PROC(nom="CHECKING_STUDY",
     StudyName           = SIMP(statut="o", typ = "TXM", defaut="ADAO Checking Case"),
     StudyRepertory      = SIMP(statut="f", typ = "Repertoire", validators=FunctionVal(ChDir), min=1, max=1),
     Debug               = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0),
+    ExecuteInContainer  = SIMP(statut="f", typ = "TXM", min=1, max=1, defaut = "No", into=("No", "Mono", "Multi")),
     AlgorithmParameters = F_AlgorithmParameters("o", ({check_names}), AlgorithmParametersInNS),
     CheckingPoint       = F_CheckingPoint("o", CheckingPointInNS),
+    Background          = F_Background("f", BackgroundInNS),
     BackgroundError     = F_BackgroundError("f", BackgroundErrorInNS),
     Observation         = F_Observation("f", ObservationInNS),
     ObservationError    = F_ObservationError("f", ObservationErrorInNS),