From: Jean-Philippe ARGAUD Date: Sun, 23 Dec 2018 17:56:04 +0000 (+0100) Subject: Various minor style correction X-Git-Tag: V9_3_0.1-prealpha1~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bfce0dfa09a0acc9ded1c50021addd8d1033da45;p=modules%2Fadao.git Various minor style correction --- diff --git a/src/daComposant/daAlgorithms/3DVAR.py b/src/daComposant/daAlgorithms/3DVAR.py index 657eae2..b1069cc 100644 --- a/src/daComposant/daAlgorithms/3DVAR.py +++ b/src/daComposant/daAlgorithms/3DVAR.py @@ -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 # --------------------------------- diff --git a/src/daComposant/daAlgorithms/Blue.py b/src/daComposant/daAlgorithms/Blue.py index 510358d..b1ea9b9 100644 --- a/src/daComposant/daAlgorithms/Blue.py +++ b/src/daComposant/daAlgorithms/Blue.py @@ -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 diff --git a/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py b/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py index 2a4cb79..597eadc 100644 --- a/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py +++ b/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py @@ -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 # diff --git a/src/daComposant/daAlgorithms/NonLinearLeastSquares.py b/src/daComposant/daAlgorithms/NonLinearLeastSquares.py index 6060817..b83261c 100644 --- a/src/daComposant/daAlgorithms/NonLinearLeastSquares.py +++ b/src/daComposant/daAlgorithms/NonLinearLeastSquares.py @@ -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) ) diff --git a/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py b/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py index 50e22d9..21e8348 100644 --- a/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py +++ b/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py @@ -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 ) # diff --git a/src/daComposant/daCore/PlatformInfo.py b/src/daComposant/daCore/PlatformInfo.py index 51f6f5f..2d474c7 100644 --- a/src/daComposant/daCore/PlatformInfo.py +++ b/src/daComposant/daCore/PlatformInfo.py @@ -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 """