summaryrefslogtreecommitdiff
path: root/UnitOperations.py
diff options
context:
space:
mode:
authorpravindalve2020-06-25 14:56:00 +0530
committerpravindalve2020-06-25 14:56:00 +0530
commitda8e13197c906ee90ba8672567b6670a291eb2c1 (patch)
treecd78e32c16d626b028a5f10f123e60fa731addfe /UnitOperations.py
parent304347a14fb0a5d770717e08f10efaed84d51902 (diff)
downloadChemical-Simulator-GUI-da8e13197c906ee90ba8672567b6670a291eb2c1.tar.gz
Chemical-Simulator-GUI-da8e13197c906ee90ba8672567b6670a291eb2c1.tar.bz2
Chemical-Simulator-GUI-da8e13197c906ee90ba8672567b6670a291eb2c1.zip
Generalization for integer and float variables in flowsheet_initialization
Diffstat (limited to 'UnitOperations.py')
-rw-r--r--UnitOperations.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/UnitOperations.py b/UnitOperations.py
index ea7c916..595a49d 100644
--- a/UnitOperations.py
+++ b/UnitOperations.py
@@ -130,8 +130,8 @@ class UnitOperation():
for k in self.parameters:
self.OM_data_init += ', '
- self.OM_data_init += k + ' = ' + ('"' + self.variables[k]['value'] + '"' if isinstance(self.variables[k]['value'], str)
- else str(json.dumps(self.variables[k]['value']).replace('[', '{').replace(']', '}')))
+ self.OM_data_init += k + ' = ' + (json.dumps(self.variables[k]['value']) if json.dumps(self.variables[k]['value']).replace('"', '').replace('_', '').isalpha()
+ else json.dumps(self.variables[k]['value']).replace('[', '{').replace(']', '}').replace('"', ''))
self.OM_data_init += ');\n'
return self.OM_data_init