From a048a11bc7ea6bb1a6515154b3bc7f13b24e3dbc Mon Sep 17 00:00:00 2001 From: Paola Date: Thu, 7 Mar 2024 12:45:46 -0300 Subject: [PATCH] clean up of convert function --- pyMBE.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pyMBE.py b/pyMBE.py index 5eec1ce..5cc5dfe 100644 --- a/pyMBE.py +++ b/pyMBE.py @@ -504,8 +504,6 @@ def convert_columns_to_original_format (self, df): columns_with_list_or_dict = ['sequence', 'residue_list','side_chains', 'parameters_of_the_potential'] - column_with_special_dict = ['bond_object'] - for column_name in columns_with_list_or_dict: df[column_name] = df[column_name].apply(lambda x: literal_eval(x) if self.pd.notnull(x) else x) @@ -513,9 +511,7 @@ def convert_columns_to_original_format (self, df): df[column_name] = df[column_name].apply(lambda x: self.create_variable_with_units(x) if self.pd.notnull(x) else x) - for column_name in column_with_special_dict: - - df[column_name] = df[column_name].apply(lambda x: (self.convert_str_to_bond_object(x)) if self.pd.notnull(x) else x) + df['bond_object'] = df['bond_object'].apply(lambda x: (self.convert_str_to_bond_object(x)) if self.pd.notnull(x) else x) return df