From cdf807ad5e31e4e2e3a97b05127f74910cc14129 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Thu, 16 Apr 2015 21:28:15 +0200 Subject: [PATCH] Documentation and source minor corrections and improvements --- src/daComposant/daCore/BasicObjects.py | 3 ++- src/daEficas/generator_adao.py | 13 +++++++++++-- src/daSalome/adaoBuilder.py | 6 ++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/daComposant/daCore/BasicObjects.py b/src/daComposant/daCore/BasicObjects.py index f0b7414..d1715d6 100644 --- a/src/daComposant/daCore/BasicObjects.py +++ b/src/daComposant/daCore/BasicObjects.py @@ -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 ) diff --git a/src/daEficas/generator_adao.py b/src/daEficas/generator_adao.py index 64a35fe..002e9c6 100644 --- a/src/daEficas/generator_adao.py +++ b/src/daEficas/generator_adao.py @@ -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" diff --git a/src/daSalome/adaoBuilder.py b/src/daSalome/adaoBuilder.py index fa88b28..454595e 100644 --- a/src/daSalome/adaoBuilder.py +++ b/src/daSalome/adaoBuilder.py @@ -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: -- 2.39.2