From 89dcaec656f988e7e2cb0731e37b33215e443366 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Fri, 30 Mar 2018 15:43:55 +0200 Subject: [PATCH] Minor correction for case file stability --- src/daEficas/generator_adao.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/daEficas/generator_adao.py b/src/daEficas/generator_adao.py index 134abc7..47f4a1f 100644 --- a/src/daEficas/generator_adao.py +++ b/src/daEficas/generator_adao.py @@ -305,14 +305,14 @@ class AdaoGenerator(PythonGenerator): if from_type == "Script": data = self.dictMCVal["__"+self.type_of_study+"__AlgorithmParameters__Dict__data__SCRIPT_DATA__SCRIPT_FILE"] - self.text_da += data_name + "_config = {} \n" + 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['Data'] = '" + data + "'\n" self.text_da += "study_config['" + data_name + "'] = " + data_name + "_config\n" elif from_type == "String": data = self.dictMCVal["__"+self.type_of_study+"__AlgorithmParameters__Dict__data__STRING_DATA__STRING"] - self.text_da += data_name + "_config = {} \n" + 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['Data'] = '" + data + "'\n" @@ -335,11 +335,12 @@ class AdaoGenerator(PythonGenerator): 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'] = 'String'\n" - self.text_da += data_name + "_config['Data'] = '" + data + "'\n" - self.text_da += "study_config['" + data_name + "'] = " + data_name + "_config\n" + if 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'] = 'String'\n" + self.text_da += data_name + "_config['Data'] = '" + data + "'\n" + self.text_da += "study_config['" + data_name + "'] = " + data_name + "_config\n" def add_variables(self): -- 2.39.2