From: Jean-Philippe ARGAUD Date: Wed, 17 Nov 2021 12:45:45 +0000 (+0100) Subject: Minor documentation and code review corrections (4) X-Git-Tag: V9_8_0rc1~9 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=667ac93fc18b01c71cc26755cb06dc9aa9490817;p=modules%2Fadao.git Minor documentation and code review corrections (4) Avoid some confusing conversions in messages or printing --- diff --git a/bin/AdaoCatalogGenerator.py b/bin/AdaoCatalogGenerator.py index f2d306a..a1641f1 100644 --- a/bin/AdaoCatalogGenerator.py +++ b/bin/AdaoCatalogGenerator.py @@ -136,7 +136,7 @@ def ColDataFileExtVal(filename): 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) +# Important : validators=[...] pour que les conditions soient traitées simultanément, en "ET", et pas en "OU" (choisi dans le cas du tuple a la place de la liste) # validators=[OnlyStr(), FileExtVal('py'), FunctionVal(fv)] data_method = """ def F_{data_name}(statut, fv=NoCheckInNS) : return FACT( diff --git a/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py b/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py index e5161a1..3ef6c63 100644 --- a/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py +++ b/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py @@ -40,7 +40,6 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "MLEF", "IEnKF", "EnKS", - "E3DVAR", ], listadv = [ "StochasticEnKF", @@ -57,6 +56,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "IEnKF-B", "EnKS-KFF", "IEKF", + "E3DVAR", "E3DVAR-EnKF", "E3DVAR-ETKF", "E3DVAR-MLEF", diff --git a/src/daComposant/daCore/Interfaces.py b/src/daComposant/daCore/Interfaces.py index 6d301ae..f6acaf2 100644 --- a/src/daComposant/daCore/Interfaces.py +++ b/src/daComposant/daCore/Interfaces.py @@ -522,7 +522,7 @@ class _SCDViewer(GenericCaseViewer): self._addLine("Analysis_config = {}") self._addLine("Analysis_config['From'] = 'String'") self._addLine("Analysis_config['Data'] = \"\"\"import numpy") - self._addLine("xa=numpy.ravel(ADD.get('Analysis')[-1])") + self._addLine("xa=ADD.get('Analysis')[-1]") self._addLine("print('Analysis:',xa)\"\"\"") self._addLine("study_config['UserPostAnalysis'] = Analysis_config") def __loadVariablesByScript(self): diff --git a/src/daComposant/daCore/Templates.py b/src/daComposant/daCore/Templates.py index e06d714..294cfd3 100644 --- a/src/daComposant/daCore/Templates.py +++ b/src/daComposant/daCore/Templates.py @@ -230,25 +230,46 @@ UserPostAnalysisTemplates = TemplateStorage() UserPostAnalysisTemplates.store( name = "AnalysisPrinter", - content = """print('# Post-analysis')\nimport numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nprint('Analysis',xa)""", + content = """print('# Post-analysis')\nimport numpy\nxa=ADD.get('Analysis')[-1]\nprint('Analysis',xa)""", fr_FR = "Imprime sur la sortie standard la valeur optimale", en_EN = "Print on standard output the optimal value", order = "next", ) UserPostAnalysisTemplates.store( name = "AnalysisSaver", - content = """print('# Post-analysis')\nimport numpy\nxa=numpy.ravel(ADD.get('Analysis')[-1])\nf='/tmp/analysis.txt'\nprint('Analysis saved in \"%s\"'%f)\nnumpy.savetxt(f,xa)""", + content = """print('# Post-analysis')\nimport numpy\nxa=ADD.get('Analysis')[-1]\nf='/tmp/analysis.txt'\nprint('Analysis saved in \"%s\"'%f)\nnumpy.savetxt(f,xa)""", fr_FR = "Enregistre la valeur optimale dans un fichier du répertoire '/tmp' nommé 'analysis.txt'", en_EN = "Save the optimal value in a file of the '/tmp' directory named 'analysis.txt'", order = "next", ) UserPostAnalysisTemplates.store( name = "AnalysisPrinterAndSaver", - content = """print('# Post-analysis')\nimport 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)""", + content = """print('# Post-analysis')\nimport numpy\nxa=ADD.get('Analysis')[-1]\nprint 'Analysis',xa\nf='/tmp/analysis.txt'\nprint('Analysis saved in \"%s\"'%f)\nnumpy.savetxt(f,xa)""", fr_FR = "Imprime sur la sortie standard et, en même temps enregistre dans un fichier du répertoire '/tmp', la valeur optimale", en_EN = "Print on standard output and, in the same time save in a file of the '/tmp' directory, the optimal value", order = "next", ) +UserPostAnalysisTemplates.store( + name = "AnalysisSeriePrinter", + content = """print('# Post-analysis')\nimport numpy\nxa=ADD.get('Analysis')\nprint('Analysis',xa)""", + fr_FR = "Imprime sur la sortie standard la série des valeurs optimales", + en_EN = "Print on standard output the optimal value series", + order = "next", + ) +UserPostAnalysisTemplates.store( + name = "AnalysisSerieSaver", + content = """print('# Post-analysis')\nimport numpy\nxa=ADD.get('Analysis')\nf='/tmp/analysis.txt'\nprint('Analysis saved in \"%s\"'%f)\nnumpy.savetxt(f,xa)""", + fr_FR = "Enregistre la série des valeurs optimales dans un fichier du répertoire '/tmp' nommé 'analysis.txt'", + en_EN = "Save the optimal value series in a file of the '/tmp' directory named 'analysis.txt'", + order = "next", + ) +UserPostAnalysisTemplates.store( + name = "AnalysisSeriePrinterAndSaver", + content = """print('# Post-analysis')\nimport numpy\nxa=ADD.get('Analysis')\nprint 'Analysis',xa\nf='/tmp/analysis.txt'\nprint('Analysis saved in \"%s\"'%f)\nnumpy.savetxt(f,xa)""", + fr_FR = "Imprime sur la sortie standard et, en même temps enregistre dans un fichier du répertoire '/tmp', la série des valeurs optimales", + en_EN = "Print on standard output and, in the same time save in a file of the '/tmp' directory, the optimal value series", + order = "next", + ) # ============================================================================== if __name__ == "__main__":