X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FdaComposant%2FdaAlgorithms%2FGradientTest.py;h=81814c3f43b5ba42debfd64c763e6ac6156b7352;hb=59c9144c3b491494cb2beeb10093f232a5e13f2a;hp=03a43520e25967b70381bb3ef2b9204b4a8091a1;hpb=645aebaf1aeb203ec7c72edbdaf39cb12e4fca0e;p=modules%2Fadao.git diff --git a/src/daComposant/daAlgorithms/GradientTest.py b/src/daComposant/daAlgorithms/GradientTest.py index 03a4352..81814c3 100644 --- a/src/daComposant/daAlgorithms/GradientTest.py +++ b/src/daComposant/daAlgorithms/GradientTest.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2008-2017 EDF R&D +# Copyright (C) 2008-2020 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 @@ -100,14 +100,21 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): default = [], typecast = tuple, message = "Liste de calculs supplémentaires à stocker et/ou effectuer", - listval = ["CurrentState", "Residu", "SimulatedObservationAtCurrentState"] + listval = [ + "CurrentState", + "Residu", + "SimulatedObservationAtCurrentState", + ] ) self.requireInputArguments( mandatory= ("Xb", "HO"), ) + self.setAttributes(tags=( + "Checking", + )) def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None): - self._pre_run(Parameters, Xb, Y, R, B, Q) + self._pre_run(Parameters, Xb, Y, U, HO, EM, CM, R, B, Q) # Hm = HO["Direct"].appliedTo if self._parameters["ResiduFormula"] in ["Taylor", "TaylorOnNorm"]: @@ -121,9 +128,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): FX = numpy.asmatrix(numpy.ravel( Hm( X ) )).T NormeX = numpy.linalg.norm( X ) NormeFX = numpy.linalg.norm( FX ) - if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]: + if self._toStore("CurrentState"): self.StoredVariables["CurrentState"].store( numpy.ravel(Xn) ) - if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]: + if self._toStore("SimulatedObservationAtCurrentState"): self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX) ) # if len(self._parameters["InitialDirection"]) == 0: @@ -237,9 +244,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): FX_plus_dX = Hm( X + dX ) FX_plus_dX = numpy.asmatrix(numpy.ravel( FX_plus_dX )).T # - if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]: + if self._toStore("CurrentState"): self.StoredVariables["CurrentState"].store( numpy.ravel(X + dX) ) - if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]: + if self._toStore("SimulatedObservationAtCurrentState"): self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) ) # NormedX = numpy.linalg.norm( dX ) @@ -377,4 +384,4 @@ def dessiner( # ============================================================================== if __name__ == "__main__": - print('\n AUTODIAGNOSTIC \n') + print('\n AUTODIAGNOSTIC\n')