Skip to content
Snippets Groups Projects
Commit 8c21c15c authored by wactbprot's avatar wactbprot
Browse files

deal with string N

parent ab97c691
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,10 @@ class Utils(System): ...@@ -52,7 +52,10 @@ class Utils(System):
return self.ensure_format([v for v, _ in sorted_zip_list]), [n for _, n in sorted_zip_list] return self.ensure_format([v for v, _ in sorted_zip_list]), [n for _, n in sorted_zip_list]
def acc_pressure(self, value_dict, form_pressure_acc, n_acc): def acc_pressure(self, value_dict, form_pressure_acc, n_acc):
""" Unit of pressure accumulator is self.unit """ Unit of pressure accumulator is self.unit. The todo Values are
searched and compared in the string format. The N-list must be converted
to an integer since operations like > and +1 are applied.
""" """
ok = ['Unit' in value_dict, ok = ['Unit' in value_dict,
'Value' in value_dict, 'Value' in value_dict,
...@@ -61,6 +64,7 @@ class Utils(System): ...@@ -61,6 +64,7 @@ class Utils(System):
if all(ok): if all(ok):
form_array = self.ensure_format( self.get_value( value_dict , self.unit)) form_array = self.ensure_format( self.get_value( value_dict , self.unit))
n_array = value_dict.get('N', [1] * len(form_array)) n_array = value_dict.get('N', [1] * len(form_array))
n_array = [int(i) for i in n_array]
for i, form_value in enumerate(form_array): for i, form_value in enumerate(form_array):
if not form_value in form_pressure_acc: if not form_value in form_pressure_acc:
form_pressure_acc.append(form_value) form_pressure_acc.append(form_value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment