]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Various minor style correction
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 23 Dec 2018 17:56:04 +0000 (18:56 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 23 Dec 2018 17:56:04 +0000 (18:56 +0100)
src/daComposant/daAlgorithms/3DVAR.py
src/daComposant/daAlgorithms/Blue.py
src/daComposant/daAlgorithms/ExtendedKalmanFilter.py
src/daComposant/daAlgorithms/NonLinearLeastSquares.py
src/daComposant/daAlgorithms/UnscentedKalmanFilter.py
src/daComposant/daCore/PlatformInfo.py

index 657eae2ecbd47cbbb3762234391a8fa83ece2bbc..b1069ccbc1ca122d62b29282dce7d7abe484f5a9 100644 (file)
@@ -150,7 +150,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # Utilisation éventuelle d'un vecteur H(Xb) précalculé
         # ----------------------------------------------------
         if HO["AppliedInX"] is not None and "HXb" in HO["AppliedInX"]:
-            HXb = Hm( Xb, HO["AppliedInX"]["HXb"])
+            HXb = Hm( Xb, HO["AppliedInX"]["HXb"] )
         else:
             HXb = Hm( Xb )
         HXb = numpy.asmatrix(numpy.ravel( HXb )).T
@@ -176,7 +176,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             _HX = numpy.asmatrix(numpy.ravel( _HX )).T
             _Innovation = Y - _HX
             if self._toStore("SimulatedObservationAtCurrentState") or \
-               self._toStore("SimulatedObservationAtCurrentOptimum"):
+                self._toStore("SimulatedObservationAtCurrentOptimum"):
                 self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
             if self._toStore("InnovationAtCurrentState"):
                 self.StoredVariables["InnovationAtCurrentState"].store( _Innovation )
@@ -313,7 +313,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             elif self._toStore("SimulatedObservationAtCurrentOptimum"):
                 HXa = self.StoredVariables["SimulatedObservationAtCurrentOptimum"][-1]
             else:
-                HXa = Hm(Xa)
+                HXa = Hm( Xa )
         #
         # Calcul de la covariance d'analyse
         # ---------------------------------
index 510358d1738eb77600081410a6f1f4f618312012..b1ea9b9a0c1e287d11866e1c3ddfb05273dda865 100644 (file)
@@ -146,8 +146,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             HXa = Hm * Xa
             oma = Y - HXa
         if self._parameters["StoreInternalVariables"] or \
-           self._toStore("CostFunctionJ") or \
-           self._toStore("MahalanobisConsistency"):
+            self._toStore("CostFunctionJ") or \
+            self._toStore("MahalanobisConsistency"):
             Jb  = float( 0.5 * (Xa - Xb).T * BI * (Xa - Xb) )
             Jo  = float( 0.5 * oma.T * RI * oma )
             J   = Jb + Jo
index 2a4cb79914ed24e14bb1d5a0a93b147e40c77709..597eadc90320efb7bc2db0b3067c085ee8131769 100644 (file)
@@ -84,10 +84,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         #
         # Opérateurs
         # ----------
-        H = HO["Direct"].appliedControledFormTo
+        Hm = HO["Direct"].appliedControledFormTo
         #
         if self._parameters["EstimationOf"] == "State":
-            M = EM["Direct"].appliedControledFormTo
+            Mm = EM["Direct"].appliedControledFormTo
         #
         if CM is not None and "Tangent" in CM and U is not None:
             Cm = CM["Tangent"].asMatrix(Xb)
@@ -150,7 +150,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                 Un = None
             #
             if self._parameters["EstimationOf"] == "State":
-                Xn_predicted = numpy.asmatrix(numpy.ravel( M( (Xn, Un) ) )).T
+                Xn_predicted = numpy.asmatrix(numpy.ravel( Mm( (Xn, Un) ) )).T
                 if Cm is not None and Un is not None: # Attention : si Cm est aussi dans M, doublon !
                     Cm = Cm.reshape(Xn.size,Un.size) # ADAO & check shape
                     Xn_predicted = Xn_predicted + Cm * Un
@@ -165,9 +165,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                 Xn_predicted = numpy.min(numpy.hstack((Xn_predicted,numpy.asmatrix(self._parameters["Bounds"])[:,1])),axis=1)
             #
             if self._parameters["EstimationOf"] == "State":
-                d  = Ynpu - numpy.asmatrix(numpy.ravel( H( (Xn_predicted, None) ) )).T
+                d  = Ynpu - numpy.asmatrix(numpy.ravel( Hm( (Xn_predicted, None) ) )).T
             elif self._parameters["EstimationOf"] == "Parameters":
-                d  = Ynpu - numpy.asmatrix(numpy.ravel( H( (Xn_predicted, Un) ) )).T
+                d  = Ynpu - numpy.asmatrix(numpy.ravel( Hm( (Xn_predicted, Un) ) )).T
                 if Cm is not None and Un is not None: # Attention : si Cm est aussi dans H, doublon !
                     d = d - Cm * Un
             #
index 6060817cf99d25d6873880d3fecbd100ab83c74a..b83261cf412172bed48d94d117e3d834a5d33529 100644 (file)
@@ -116,7 +116,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # Utilisation éventuelle d'un vecteur H(Xb) précalculé
         # ----------------------------------------------------
         if HO["AppliedInX"] is not None and "HXb" in HO["AppliedInX"]:
-            HXb = Hm( Xb, HO["AppliedInX"]["HXb"])
+            HXb = Hm( Xb, HO["AppliedInX"]["HXb"] )
         else:
             HXb = Hm( Xb )
         HXb = numpy.asmatrix(numpy.ravel( HXb )).T
@@ -316,12 +316,13 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             elif self._toStore("SimulatedObservationAtCurrentOptimum"):
                 HXa = self.StoredVariables["SimulatedObservationAtCurrentOptimum"][-1]
             else:
-                HXa = Hm(Xa)
+                HXa = Hm( Xa )
         #
         #
         # Calculs et/ou stockages supplémentaires
         # ---------------------------------------
-        if self._toStore("Innovation") or self._toStore("OMB"):
+        if self._toStore("Innovation") or \
+            self._toStore("OMB"):
             d  = Y - HXb
         if self._toStore("Innovation"):
             self.StoredVariables["Innovation"].store( numpy.ravel(d) )
index 50e22d95c465e029f8e2411b64ab218a9b4c5d4f..21e834871740dab8028211118dec5d6cae4a8e59 100644 (file)
@@ -135,10 +135,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         #
         # Opérateurs
         # ----------
-        H = HO["Direct"].appliedControledFormTo
+        Hm = HO["Direct"].appliedControledFormTo
         #
         if self._parameters["EstimationOf"] == "State":
-            M = EM["Direct"].appliedControledFormTo
+            Mm = EM["Direct"].appliedControledFormTo
         #
         if CM is not None and "Tangent" in CM and U is not None:
             Cm = CM["Tangent"].asMatrix(Xb)
@@ -204,7 +204,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             XEtnnp = []
             for point in range(nbSpts):
                 if self._parameters["EstimationOf"] == "State":
-                    XEtnnpi = numpy.asmatrix(numpy.ravel( M( (Xnp[:,point], Un) ) )).T
+                    XEtnnpi = numpy.asmatrix(numpy.ravel( Mm( (Xnp[:,point], Un) ) )).T
                     if Cm is not None and Un is not None: # Attention : si Cm est aussi dans M, doublon !
                         Cm = Cm.reshape(Xn.size,Un.size) # ADAO & check shape
                         XEtnnpi = XEtnnpi + Cm * Un
@@ -243,9 +243,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             Ynnp = []
             for point in range(nbSpts):
                 if self._parameters["EstimationOf"] == "State":
-                    Ynnpi = numpy.asmatrix(numpy.ravel( H( (Xnnp[:,point], None) ) )).T
+                    Ynnpi = numpy.asmatrix(numpy.ravel( Hm( (Xnnp[:,point], None) ) )).T
                 elif self._parameters["EstimationOf"] == "Parameters":
-                    Ynnpi = numpy.asmatrix(numpy.ravel( H( (Xnnp[:,point], Un) ) )).T
+                    Ynnpi = numpy.asmatrix(numpy.ravel( Hm( (Xnnp[:,point], Un) ) )).T
                 Ynnp.append( Ynnpi )
             Ynnp = numpy.hstack( Ynnp )
             #
index 51f6f5fd2afa162e9c9ab63ee27f0f55d4e8f36a..2d474c7a52051cfc93f357955a9fb0897eb5faf3 100644 (file)
@@ -243,7 +243,7 @@ has_adao   = bool( "ADAO_ROOT_DIR" in os.environ )
 has_eficas = bool( "EFICAS_ROOT_DIR" in os.environ )
 
 # ==============================================================================
-def uniq(__sequence):
+def uniq( __sequence ):
     """
     Fonction pour rendre unique chaque élément d'une liste, en préservant l'ordre
     """