From bdfc6d161b35ef4d2525d4d6424610a149504d97 Mon Sep 17 00:00:00 2001 From: jrudz Date: Thu, 5 Sep 2024 09:46:13 +0200 Subject: [PATCH] fixed pytest error --- atomisticparsers/gromacs/parser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/atomisticparsers/gromacs/parser.py b/atomisticparsers/gromacs/parser.py index 77957cf..001833b 100644 --- a/atomisticparsers/gromacs/parser.py +++ b/atomisticparsers/gromacs/parser.py @@ -133,7 +133,7 @@ def str_to_input_parameters(val_in): value = val_scalar.group(2) if value.lower() in ['true', 'false']: value = value.lower() == 'true' - elif value % 1 == 0: + elif value.replace('.', '', 1).isdigit(): value = float(value) if '.' in value else int(value) stack[-1][key] = value @@ -1661,6 +1661,10 @@ def write_to_archive(self): sec_run.x_gromacs_number_of_tasks = host_info[2] # parse the input parameters using log file's hierarchical structure as default + # self.input_parameters = { + # key.replace('_', '-'): val.lower() if isinstance(val, str) else val + # for key, val in self.log_parser.get('input_parameters', {}).items() + # } self.input_parameters = self.log_parser.get('input_parameters', {}) self.standardize_input_parameters(self.input_parameters)