]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Documentation and source minor corrections and improvements
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Thu, 16 Apr 2015 19:28:15 +0000 (21:28 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Thu, 16 Apr 2015 21:12:24 +0000 (23:12 +0200)
src/daComposant/daCore/BasicObjects.py
src/daEficas/generator_adao.py
src/daSalome/adaoBuilder.py

index f0b741440f13d9f5d3a73e9108e392685096ad21..d1715d638ef3c81a60d0ee7c1722cd3e4f9a0b45 100644 (file)
@@ -92,10 +92,11 @@ class Operator:
     def __init__(self, fromMethod=None, fromMatrix=None, avoidingRedundancy = True):
         """
         On construit un objet de ce type en fournissant à l'aide de l'un des
-        deux mots-clé, soit une fonction python, soit matrice.
+        deux mots-clé, soit une fonction python, soit une matrice.
         Arguments :
         - fromMethod : argument de type fonction Python
         - fromMatrix : argument adapté au constructeur numpy.matrix
+        - avoidingRedundancy : évite ou pas les calculs redondants
         """
         self.__NbCallsAsMatrix, self.__NbCallsAsMethod, self.__NbCallsOfCached = 0, 0, 0
         self.__AvoidRC = bool( avoidingRedundancy )
index 64a35fe7af4848b6b780f36b3da4d5bd62c51661..002e9c6aabba87d86b9050956c2382671dac8a66 100644 (file)
@@ -319,11 +319,20 @@ class AdaoGenerator(PythonGenerator):
       keys = [k.replace(base,'') for k in keys]
       data  = '{'
       for k in keys:
-        data += '"%s":"%s",'%(k.split('__')[-1],self.dictMCVal[base+k])
+        key = k.split('__')[-1]
+        val = self.dictMCVal[base+k]
+        # print key," = ",val,"    ",type(val)
+        if isinstance(val, str) and key == "SetSeed":
+            data += '"%s":%s,'%(key,int(val))
+        elif isinstance(val, str) and not (val.count('[')>=2 or val.count('(')>=2):
+            data += '"%s":"%s",'%(key,val)
+        else:
+            data += '"%s":%s,'%(key,val)
+      data = data.replace("'",'"')
       data += '}'
       self.text_da += data_name + "_config = {} \n"
       self.text_da += data_name + "_config['Type'] = '" + data_type + "'\n"
-      self.text_da += data_name + "_config['From'] = '" + from_type + "'\n"
+      self.text_da += data_name + "_config['From'] = 'String'\n"
       self.text_da += data_name + "_config['Data'] = '" + data + "'\n"
       self.text_da += "study_config['" + data_name + "'] = " + data_name + "_config\n"
 
index fa88b282d17289a537190aebcbd763844807cd84..454595e81c1eccb1b184fac349046c20d1bae54e 100644 (file)
@@ -405,9 +405,11 @@ class New(object):
             if Parameters.has_key("CenteredFiniteDifference"):
                 __Parameters["withCenteredDF"] = Parameters["CenteredFiniteDifference"]
             if Parameters.has_key("EnableMultiProcessing"):
-                __Parameters["withmpEnabled"] = Parameters["EnableMultiProcessing"]
+                __Parameters["EnableMultiProcessing"] = Parameters["EnableMultiProcessing"]
+                __Parameters["withmpEnabled"]         = Parameters["EnableMultiProcessing"]
             if Parameters.has_key("NumberOfProcesses"):
-                __Parameters["withmpWorkers"] = Parameters["NumberOfProcesses"]
+                __Parameters["NumberOfProcesses"] = Parameters["NumberOfProcesses"]
+                __Parameters["withmpWorkers"]     = Parameters["NumberOfProcesses"]
         if Script is not None:
             __Matrix, __Function = None, None
             if Matrix: