Skip to content

Commit

Permalink
clean up of convert function
Browse files Browse the repository at this point in the history
  • Loading branch information
paobtorres committed Mar 7, 2024
1 parent 4ec2032 commit a048a11
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pyMBE.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,18 +504,14 @@ 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)

for column_name in columns_with_units:

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

Expand Down

0 comments on commit a048a11

Please sign in to comment.