Salome HOME
Minor documentation corrections
[modules/adao.git] / src / daComposant / daCore / Templates.py
index 2b134cb28d3ddf0b59de3f924f2c7cae1bd677e9..1d1880da77cca775a1b760df52fc1e98b1a80721 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2008-2018 EDF R&D
+# Copyright (C) 2008-2019 EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -129,22 +129,22 @@ ObserverTemplates.store(
 ObserverTemplates.store(
     name    = "ValuePrinterAndSaver",
     content = """import numpy, re\nv=numpy.array(var[-1], ndmin=1)\nprint(str(info)+" "+str(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)""",
-    fr_FR   = "Imprime sur la sortie standard et, en même temps enregistre dans un fichier, la valeur courante de la variable",
-    en_EN   = "Print on standard output and, in the same time save in a file, the current value of the variable",
+    fr_FR   = "Imprime sur la sortie standard et, en même temps enregistre dans un fichier du répertoire '/tmp', la valeur courante de la variable",
+    en_EN   = "Print on standard output and, in the same time save in a file of the '/tmp' directory, the current value of the variable",
     order   = "next",
     )
 ObserverTemplates.store(
     name    = "ValueIndexPrinterAndSaver",
     content = """import numpy, re\nv=numpy.array(var[-1], ndmin=1)\nprint(str(info)+(" index %i:"%(len(var)-1))+" "+str(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)""",
-    fr_FR   = "Imprime sur la sortie standard et, en même temps enregistre dans un fichier, la valeur courante de la variable, en ajoutant son index",
-    en_EN   = "Print on standard output and, in the same time save in a file, the current value of the variable, adding its index",
+    fr_FR   = "Imprime sur la sortie standard et, en même temps enregistre dans un fichier du répertoire '/tmp', la valeur courante de la variable, en ajoutant son index",
+    en_EN   = "Print on standard output and, in the same time save in a file of the '/tmp' directory, the current value of the variable, adding its index",
     order   = "next",
     )
 ObserverTemplates.store(
     name    = "ValueSeriePrinterAndSaver",
     content = """import numpy, re\nv=numpy.array(var[:],  ndmin=1)\nprint(str(info)+" "+str(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)""",
-    fr_FR   = "Imprime sur la sortie standard et, en même temps, enregistre dans un fichier la série des valeurs de la variable",
-    en_EN   = "Print on standard output and, in the same time, save in a file the value series of the variable",
+    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 de la variable",
+    en_EN   = "Print on standard output and, in the same time, save in a file of the '/tmp' directory, the value series of the variable",
     order   = "next",
     )
 ObserverTemplates.store(
@@ -178,15 +178,15 @@ ObserverTemplates.store(
 ObserverTemplates.store(
     name    = "ValuePrinterSaverAndGnuPlotter",
     content = """print(str(info)+" "+str(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' ) )""",
-    fr_FR   = "Imprime sur la sortie standard et, en même temps, enregistre dans un fichier et affiche graphiquement la valeur courante de la variable ",
-    en_EN   = "Print on standard output and, in the same, time save in a file and graphically plot the current value of the variable",
+    fr_FR   = "Imprime sur la sortie standard et, en même temps, enregistre dans un fichier du répertoire '/tmp' et affiche graphiquement la valeur courante de la variable ",
+    en_EN   = "Print on standard output and, in the same, time save in a file of the '/tmp' directory and graphically plot the current value of the variable",
     order   = "next",
     )
 ObserverTemplates.store(
     name    = "ValueSeriePrinterSaverAndGnuPlotter",
     content = """print(str(info)+" "+str(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' ) )""",
-    fr_FR   = "Imprime sur la sortie standard et, en même temps, enregistre dans un fichier et affiche graphiquement la série des valeurs de la variable",
-    en_EN   = "Print on standard output and, in the same, time save in a file and graphically plot the value series of the variable",
+    fr_FR   = "Imprime sur la sortie standard et, en même temps, enregistre dans un fichier du répertoire '/tmp' et affiche graphiquement la série des valeurs de la variable",
+    en_EN   = "Print on standard output and, in the same, time save in a file of the '/tmp' directory and graphically plot the value series of the variable",
     order   = "next",
     )
 ObserverTemplates.store(
@@ -212,14 +212,14 @@ ObserverTemplates.store(
     )
 ObserverTemplates.store(
     name    = "ValueL2Norm",
-    content = """import numpy\nv = numpy.matrix( numpy.ravel( var[-1] ) )\nprint(str(info)+" "+str(float( numpy.linalg.norm(v) )))""",
+    content = """import numpy\nv = numpy.ravel( var[-1] )\nprint(str(info)+" "+str(float( numpy.linalg.norm(v) )))""",
     fr_FR   = "Imprime sur la sortie standard la norme L2 de la valeur courante de la variable",
     en_EN   = "Print on standard output the L2 norm of the current value of the variable",
     order   = "next",
     )
 ObserverTemplates.store(
     name    = "ValueRMS",
-    content = """import numpy\nv = numpy.matrix( numpy.ravel( var[-1] ) )\nprint(str(info)+" "+str(float( numpy.sqrt((1./v.size)*(v*v.T)) )))""",
+    content = """import numpy\nv = numpy.ravel( var[-1] )\nprint(str(info)+" "+str(float( numpy.sqrt((1./v.size)*numpy.dot(v,v)) )))""",
     fr_FR   = "Imprime sur la sortie standard la racine de la moyenne des carrés (RMS), ou moyenne quadratique, de la valeur courante de la variable",
     en_EN   = "Print on standard output the root mean square (RMS), or quadratic mean, of the current value of the variable",
     order   = "next",
@@ -227,4 +227,4 @@ ObserverTemplates.store(
 
 # ==============================================================================
 if __name__ == "__main__":
-    print('\n AUTODIAGNOSTIC \n')
+    print('\n AUTODIAGNOSTIC\n')