Salome HOME
Minor documentation and code review corrections (40)
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Tue, 31 Jan 2023 05:12:15 +0000 (06:12 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Tue, 31 Jan 2023 05:12:15 +0000 (06:12 +0100)
16 files changed:
doc/en/notations.rst
doc/en/ref_algorithm_AdjointTest.rst
doc/en/ref_algorithm_FunctionTest.rst
doc/en/ref_algorithm_SamplingTest.rst
doc/en/scripts/simple_KalmanFilter1.py
doc/en/snippets/Header2Algo09.rst
doc/en/snippets/ModuleCompatibility.rst
doc/fr/ref_algorithm_FunctionTest.rst
doc/fr/ref_algorithm_MeasurementsOptimalPositioningTask.rst
doc/fr/ref_algorithm_SamplingTest.rst
doc/fr/scripts/simple_KalmanFilter1.py
doc/fr/snippets/ModuleCompatibility.rst
src/daComposant/daAlgorithms/LocalSensitivityTest.py
src/daComposant/daAlgorithms/SamplingTest.py
src/daComposant/daCore/BasicObjects.py
src/daComposant/daCore/PlatformInfo.py

index 539f3bdffc2d5d48955228e25c38508d1930da25..de7c1a656b41266b789256739fbb3b770125cbcf 100644 (file)
 Notations and common conventions
 ================================
 
+.. index:: single: File (naming)
+.. index:: single: File (type)
+
 In all this documentation, we use standard notations of linear algebra, data
 assimilation (as described in [Ide97]_) and optimization.
 
-For algebraic formulations, vectors are written horizontally or vertically
-without making a difference. Matrices are written either normally, or with a
-condensed notation, consisting in the use of a space to separate the values,
-and a "``;``" to separate the rows of the matrix, in a continuous line.
+For algebraic formulations, **vectors** are written horizontally or vertically
+without making a difference. **Matrices** can be written either normally as a
+serie of number series, either in text condensed notation, consisting in the
+use of a space to separate the values, and a "``;``" to separate the rows of
+the matrix, in a continuous line.
 
-Files can be indicated by an absolute or relative path. For some old or shared
-file systems, the full name with the path must not contain more than 256
-characters. In the case of Python files, it is advisable not to use dots in the
-name apart for the extension, to prevent difficulties in using it that are
-complicated to diagnose.
+**Files** can be indicated by an absolute or relative path. For some old or
+shared file systems, the full name, including the path, must not contain more
+than 256 characters. In the case of Python files, it is advisable not to use
+dots in the name apart for the extension, to prevent difficulties in using it
+that are then complicated to diagnose.
 
-File type and naming conventions rely heavily on the extensions of the files
-themselves. Some of them are briefly specified here, without being exhaustive:
+**File type and naming conventions** rely heavily on the extensions of the
+files themselves. Some of them are briefly specified here, without being
+exhaustive:
 
-- extension ``.py``   : data or commands text file of Python source type
+- extension ``.py``   : data or commands text file of Python type
 - extension ``.comm`` : commands text file of ADAO EFICAS type
 - extension ``.xml``  : data text file of XML type or commands (for YACS, not exclusive)
 - extension ``.txt``  : data text file with space separator
@@ -54,6 +59,9 @@ themselves. Some of them are briefly specified here, without being exhaustive:
 - extension ``.npz``  : data binary file of type Numpy multi-variables
 - extension ``.sdf``  : data binary file of type Scientific Data Format
 
+For the use of some of these files, one can refer to the keyword "*DataFile*"
+as :ref:`section_ref_entry_types_info`.
+
 .. ------------------------------------ ..
 .. include:: snippets/Header2Algo07.rst
 
index d18f962f18786ee6382c8642d88167d64d97c47b..07d899f78efe9b2fdeff11d94cc805e438a8bb5a 100644 (file)
@@ -38,7 +38,7 @@ For all formulas, with :math:`\mathbf{x}` the current verification point, we
 take :math:`\mathbf{dx}_0=Normal(0,\mathbf{x})` and
 :math:`\mathbf{dx}=\alpha_0*\mathbf{dx}_0` with :math:`\alpha_0` a scaling user
 parameter, defaulting to 1. :math:`F` is the computational operator or code
-(which is here acquired by the observation operator command
+(which is here defined by the observation operator command
 "*ObservationOperator*").
 
 One can observe the following residue, which is the difference of two scalar
index 3b57c3e34b756c9fd3d74844bfaea5e567d6cc54..81755ae6bb273f06148472c20d767d019f51da8b 100644 (file)
@@ -33,7 +33,9 @@ Checking algorithm "*FunctionTest*"
 This algorithm allows to verify that a given operator :math:`F`, in particular
 the observation one, is working correctly and that its call is compatible with
 its usage in ADAO algorithms. In practice, it allows to call one or several
-times the operator, activating or not the "debug" mode during execution.
+times the operator, activating or not the "debug" mode during execution. The
+:math:`F` operator is considered to depend on the vector variable
+:math:`\mathbf{x}`.
 
 Statistics on input and output vectors for each execution of operator are
 given, and an another global statistic is given at the end of the checking
index 63fbcee2b7f2f6f3ad0414032b3a78c9158c65ac..a978e7f11af6ef5412fd474bc2fdc5506385fe81 100644 (file)
@@ -103,6 +103,7 @@ StoreSupplementaryCalculations
   "CurrentState",
   "EnsembleOfSimulations",
   "EnsembleOfStates",
+  "Innovation",
   "InnovationAtCurrentState",
   "SimulatedObservationAtCurrentState",
   ].
@@ -134,6 +135,8 @@ StoreSupplementaryCalculations
 
 .. include:: snippets/EnsembleOfStates.rst
 
+.. include:: snippets/Innovation.rst
+
 .. include:: snippets/InnovationAtCurrentState.rst
 
 .. include:: snippets/SimulatedObservationAtCurrentState.rst
index 4910a21124252989438576a48015b9cbd7ce1353..eba52d52c7d86d6a36fed1988cf22bcf879e424f 100644 (file)
@@ -44,7 +44,7 @@ Xa = case.get("Analysis")
 Pa = case.get("APosterioriCovariance")
 #
 print("")
-print("  Final a posteriori variance:",Pa[-1])
+print("  Final a posteriori variance:", Pa[-1])
 print("")
 #
 #-------------------------------------------------------------------------------
index 5ad6b83dfe08c9a319f67d2d51ccecd1c4e41b80..0024c9ddac809ec3c586d8810c486ed8d40800aa 100644 (file)
@@ -3,4 +3,4 @@ Python (TUI) use examples
 
 Here is a very simple use of the given algorithm and its parameters, written in
 :ref:`section_tui`, and from which input information allow to define an
-equivalent cas in graphical interface.
+equivalent case in graphical user interface.
index 2acdc40d447904e7a4f8e3046f48e81e77168f93..1fb912ab275fad48a58ea318322dd0f543d9cda6 100644 (file)
@@ -12,8 +12,8 @@ guarantee).
    :header: "Tool", "Minimal version", "Reached version"
    :widths: 20, 10, 10
 
-   Python,     3.6.5,    3.10.8
-   Numpy,      1.14.3,    1.24.1
+   Python,     3.6.5,    3.10.9
+   Numpy,      1.14.3,    1.24.2
    Scipy,      1.1.0,    1.10.0
    MatplotLib, 2.2.2,    3.6.3
    GnuplotPy,  1.8,    1.8
index 34599b5233abd0aba24f45b9ca243c5679f6f97c..c1c8fc74338e5b724be48f6a3a67ee5c0e40a8c1 100644 (file)
@@ -34,7 +34,8 @@ Cet algorithme permet de vérifier qu'un opérateur :math:`F` quelconque, dont e
 particulier celui d'observation, fonctionne correctement et que son appel se
 déroule de manière compatible avec son usage dans les algorithmes d'ADAO. De
 manière pratique, il permet d'appeler une ou plusieurs fois l'opérateur, en
-activant ou non le mode "debug" lors de l'exécution.
+activant ou non le mode "debug" lors de l'exécution. L'opérateur :math:`F` est
+considéré comme dépendant d'une variable vectorielle :math:`\mathbf{x}`.
 
 Une statistique sur les vecteurs en entrée et en sortie de chaque exécution de
 l'opérateur est indiquée, et une autre globale est fournie de manière
index c53d92480322daa825245b1d1fb9c4fd8fac01c7..b862906252393334d1e852c959b35fa365d6602b 100644 (file)
@@ -58,8 +58,8 @@ Il y a deux manières d'utiliser cet algorithme:
 
 #. Dans son usage le plus simple, si l'ensemble des vecteurs d'état est
    pré-existant, il suffit de le fournir par l'option "*EnsembleOfSnapshots*"
-   d'algorithme. C'est par exemple le cas l'ensemble des états a été généré par
-   un :ref:`section_ref_algorithm_EnsembleOfSimulationGenerationTask`.
+   d'algorithme. C'est par exemple le cas si l'ensemble des états a été généré
+   par un :ref:`section_ref_algorithm_EnsembleOfSimulationGenerationTask`.
 #. Si l'ensemble des vecteurs d'état doit être obtenu par des simulations au
    cours de l'algorithme, alors on doit fournir l'opérateur de simulation ou
    d'observation :math:`H` et le plan d'expérience de l'espace des états
index f4bae255854f6091d87a04577cd1549dc6d1ea08..7d7553f7f89e799584ecf838ec72177e68067f0e 100644 (file)
@@ -106,6 +106,7 @@ StoreSupplementaryCalculations
   "CurrentState",
   "EnsembleOfSimulations",
   "EnsembleOfStates",
+  "Innovation",
   "InnovationAtCurrentState",
   "SimulatedObservationAtCurrentState",
   ].
@@ -137,6 +138,8 @@ StoreSupplementaryCalculations
 
 .. include:: snippets/EnsembleOfStates.rst
 
+.. include:: snippets/Innovation.rst
+
 .. include:: snippets/InnovationAtCurrentState.rst
 
 .. include:: snippets/SimulatedObservationAtCurrentState.rst
index c81d2a51ffd14c8e0f7a0a77b506c2ec84073a29..b8425a7fabfb7e4215576c664c3f181c4ab61a72 100644 (file)
@@ -44,7 +44,7 @@ Xa = case.get("Analysis")
 Pa = case.get("APosterioriCovariance")
 #
 print("")
-print("  Variance a posteriori finale :",Pa[-1])
+print("  Variance a posteriori finale :", Pa[-1])
 print("")
 #
 #-------------------------------------------------------------------------------
index 06d4ce47f509597630f9ce9641866ab460febf52..cbe732585ffd2efe39407bcf08852caf7a52090d 100644 (file)
@@ -12,8 +12,8 @@ la version atteinte (mais cela reste sans garantie).
    :header: "Outil", "Version minimale", "Version atteinte"
    :widths: 20, 10, 10
 
-   Python,     3.6.5,    3.10.8
-   Numpy,      1.14.3,    1.24.1
+   Python,     3.6.5,    3.10.9
+   Numpy,      1.14.3,    1.24.2
    Scipy,      1.1.0,    1.10.0
    MatplotLib, 2.2.2,    3.6.3
    GnuplotPy,  1.8,    1.8
index 25787465e270c31903a33db1e6cd035a7e84e7b8..89f5962de6c09b281d30d6fe60ea98baf2f6879d 100644 (file)
@@ -81,9 +81,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                 HXb = Ht @ Xb
             HXb = numpy.ravel( HXb ).reshape((-1,1))
             if Y.size != HXb.size:
-                raise ValueError("The size %i of observations Y and %i of observed calculation H(X) are different, they have to be identical."%(Y.size,HXb.size))
+                raise ValueError("The size %i of observations Yobs and %i of observed calculation F(X) are different, they have to be identical."%(Y.size,HXb.size))
             if max(Y.shape) != max(HXb.shape):
-                raise ValueError("The shapes %s of observations Y and %s of observed calculation H(X) are different, they have to be identical."%(Y.shape,HXb.shape))
+                raise ValueError("The shapes %s of observations Yobs and %s of observed calculation F(X) are different, they have to be identical."%(Y.shape,HXb.shape))
             self.StoredVariables["SimulatedObservationAtCurrentState"].store( HXb )
         #
         self._post_run(HO)
index 4f543d225ecc44ded13f379b4a408764a2cfc563..0d7c5774c1f963dfb331682bf24257dc54e2af0d 100644 (file)
 # Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
 
 import numpy, logging
-from daCore import BasicObjects, NumericObjects
+from daCore import BasicObjects, NumericObjects, PlatformInfo
 from daAlgorithms.Atoms import eosg
-from daCore.PlatformInfo import PlatformInfo
-mfp = PlatformInfo().MaximumPrecision()
+mfp = PlatformInfo.PlatformInfo().MaximumPrecision()
 
 # ==============================================================================
 class ElementaryAlgorithm(BasicObjects.Algorithm):
@@ -90,6 +89,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                 "CurrentState",
                 "EnsembleOfSimulations",
                 "EnsembleOfStates",
+                "Innovation",
                 "InnovationAtCurrentState",
                 "SimulatedObservationAtCurrentState",
                 ]
@@ -147,6 +147,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                     Jo  = numpy.max( numpy.abs(_Innovation) )
                 #
                 J   = Jb + Jo
+            if self._toStore("Innovation"):
+                self.StoredVariables["Innovation"].store( _Innovation )
             if self._toStore("CurrentState"):
                 self.StoredVariables["CurrentState"].store( _X )
             if self._toStore("InnovationAtCurrentState"):
index eefbea3806812c12230658e7ad229270ecbf40a7..acddc3577447e74f1bcee2b7ce085dcc99f2f938 100644 (file)
@@ -976,7 +976,7 @@ class Algorithm(object):
             except Exception:
                 raise KeyError(msg)
 
-    def run(self, Xb=None, Y=None, H=None, M=None, R=None, B=None, Q=None, Parameters=None):
+    def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         """
         Doit implémenter l'opération élémentaire de calcul algorithmique.
         """
index 128cebbe66aa742e42289e58471266124547baec..72795096d324e23d1926cbf232b126d82f2139f8 100644 (file)
@@ -122,7 +122,10 @@ class PlatformInfo(object):
         __msg += "\n%s%30s : %s" %(__prefix,"sys.executable",sys.executable)
         __msg += "\n%s%30s : %s" %(__prefix,"sys.version",sys.version.replace('\n',''))
         __msg += "\n%s%30s : %s" %(__prefix,"sys.getfilesystemencoding",str(sys.getfilesystemencoding()))
-        __msg += "\n%s%30s : %s" %(__prefix,"locale.getdefaultlocale",str(locale.getdefaultlocale()))
+        if  sys.version_info.major == 3 and sys.version_info.minor < 11: # Python 3.10
+            __msg += "\n%s%30s : %s" %(__prefix,"locale.getdefaultlocale",str(locale.getdefaultlocale()))
+        else:
+            __msg += "\n%s%30s : %s" %(__prefix,"locale.getlocale",str(locale.getlocale()))
         __msg += "\n"
         __msg += "\n%s%30s : %s" %(__prefix,"os.cpu_count",os.cpu_count())
         if hasattr(os, 'sched_getaffinity'):