Salome HOME
Updating copyright date information
[modules/adao.git] / src / daComposant / daDiagnostics / ReduceVariance.py
index 2272eac1fedad180c1613ea57897bd82d6a224ed..99f1db27bdcf2a4bc2fad0508f6ee86a5cfc5a7e 100644 (file)
@@ -1,39 +1,34 @@
 #-*-coding:iso-8859-1-*-
 #
-#  Copyright (C) 2008-2009  EDF R&D
+# Copyright (C) 2008-2016 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
-#  License as published by the Free Software Foundation; either
-#  version 2.1 of the License.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
 #
-#  This library is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-__doc__ = """
-    Diagnostic sur la reduction de la variance lors de l'analyse
-"""
-__author__ = "Jean-Philippe ARGAUD - Septembre 2008"
-
-import sys ; sys.path.insert(0, "../daCore")
 
 import numpy
-import Persistence
-from BasicObjects import Diagnostic
-from AssimilationStudy import AssimilationStudy
+from daCore import BasicObjects, Persistence
 
 # ==============================================================================
-class ElementaryDiagnostic(Diagnostic,Persistence.OneScalar):
+class ElementaryDiagnostic(BasicObjects.Diagnostic,Persistence.OneScalar):
+    """
+    Diagnostic sur la reduction de la variance lors de l'analyse
+    """
     def __init__(self, name = "", unit = "", basetype = None, parameters = {}):
-        Diagnostic.__init__(self, name, parameters)
+        BasicObjects.Diagnostic.__init__(self, name, parameters)
         Persistence.OneScalar.__init__( self, name, unit, basetype = bool )
 
     def _formula(self, V1, V2):
@@ -91,7 +86,7 @@ if __name__ == "__main__":
     print " La variance de OMA est de...........................:", x2.var()
     #
     D.calculate( vectorOMB = x1,  vectorOMA = x2)
-    if not D.valueserie(0) :
+    if not D[0] :
             print " Résultat : l'analyse NE RÉDUIT PAS la variance"
     else :
             print " Résultat : l'analyse RÉDUIT la variance"
@@ -109,7 +104,7 @@ if __name__ == "__main__":
     print " La variance de OMA est de...........................:", x2.var()
     #
     D.calculate( vectorOMB = x1,  vectorOMA = x2)
-    if not D.valueserie(1) :
+    if not D[1] :
             print " Résultat : l'analyse NE RÉDUIT PAS la variance"
     else :
             print " Résultat : l'analyse RÉDUIT la variance"