]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Code review corrections for special cases
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sat, 30 Dec 2023 20:40:23 +0000 (21:40 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sat, 30 Dec 2023 20:40:23 +0000 (21:40 +0100)
src/daComposant/daAlgorithms/Atoms/eosg.py
src/daComposant/daCore/BasicObjects.py
src/daComposant/daCore/NumericObjects.py
src/daComposant/daCore/Persistence.py

index 801a44045ed92574ad9a7db02c263bc10e9ec5ff..d2e394553bf4a137273f25bdf46756fd709dba4e 100644 (file)
@@ -89,6 +89,9 @@ def eosg(selfA, Xb, HO, outputEOX = False, assumeNoFailure = True):
                     EOS[i] = numpy.nan*numpy.ones(__s)
             EOS = numpy.stack(EOS, axis=1)
     #
+    if len(EOS.shape) > 2 and EOS.shape[2]==1: # RaJ si transposition de Hm
+        EOS = EOS.squeeze( axis = 2 )
+    #
     if selfA._parameters["SetDebug"]:
         print("\n     %s\n"%("-"*75,))
         print("===> End evaluation, deactivating debug if necessary\n")
index 659e34d8d11ecb1e6ec6474965f8e50aee05ab8b..064400c9dc8555df169e643cc7fb4699316ce2dc 100644 (file)
@@ -779,9 +779,9 @@ class Algorithm(object):
         self.StoredVariables["CurrentOptimum"]                       = Persistence.OneVector(name = "CurrentOptimum")
         self.StoredVariables["CurrentState"]                         = Persistence.OneVector(name = "CurrentState")
         self.StoredVariables["CurrentStepNumber"]                    = Persistence.OneIndex(name  = "CurrentStepNumber")
-        self.StoredVariables["EnsembleOfSimulations"]                = Persistence.OneMatrix(name = "EnsembleOfSimulations")
-        self.StoredVariables["EnsembleOfSnapshots"]                  = Persistence.OneMatrix(name = "EnsembleOfSnapshots")
-        self.StoredVariables["EnsembleOfStates"]                     = Persistence.OneMatrix(name = "EnsembleOfStates")
+        self.StoredVariables["EnsembleOfSimulations"]                = Persistence.OneMatrice(name = "EnsembleOfSimulations")
+        self.StoredVariables["EnsembleOfSnapshots"]                  = Persistence.OneMatrice(name = "EnsembleOfSnapshots")
+        self.StoredVariables["EnsembleOfStates"]                     = Persistence.OneMatrice(name = "EnsembleOfStates")
         self.StoredVariables["ExcludedPoints"]                       = Persistence.OneVector(name = "ExcludedPoints")
         self.StoredVariables["ForecastCovariance"]                   = Persistence.OneMatrix(name = "ForecastCovariance")
         self.StoredVariables["ForecastState"]                        = Persistence.OneVector(name = "ForecastState")
index 7f56831ab0b71b9c17c873428ba32f66ef2cd72d..5adc6413d406d62d9504153e25471fbcc9633096 100644 (file)
@@ -1083,7 +1083,7 @@ def BuildComplexSampleList(
         sampleList = __SampleAsnUplet
         for i,Xx in enumerate(sampleList):
             if numpy.ravel(Xx).size != __X0.size:
-                raise ValueError("The size %i of the %ith state X in the sample and %i of the checking point Xb are different, they have to be identical."%(numpy.ravel(Xx).size,i+1,X0.size))
+                raise ValueError("The size %i of the %ith state X in the sample and %i of the checking point Xb are different, they have to be identical."%(numpy.ravel(Xx).size,i+1,__X0.size))
     # ---------------------------
     elif len(__SampleAsExplicitHyperCube) > 0:
         sampleList = itertools.product(*list(__SampleAsExplicitHyperCube))
index 9b5cd08bc3a51fe77c4fc89106c286a26145548f..34bafb186feffe162b4b5dbcc47c57fdc6274e9c 100644 (file)
@@ -849,6 +849,15 @@ class OneVector(Persistence):
     def __init__(self, name="", unit="", basetype = numpy.ravel):
         Persistence.__init__(self, name, unit, basetype)
 
+class OneMatrice(Persistence):
+    """
+    Classe de stockage d'une matrice de valeurs homogènes par pas.
+    """
+    __slots__ = ()
+    #
+    def __init__(self, name="", unit="", basetype = numpy.array):
+        Persistence.__init__(self, name, unit, basetype)
+
 class OneMatrix(Persistence):
     """
     Classe de stockage d'une matrice de valeurs homogènes par pas.