@@ -184,7 +184,7 @@ def fragment_and_process(self, bonds):
184
184
if not frags_done :
185
185
# If we haven't, we save this pair and search for the relevant fragment entries:
186
186
self .done_frag_pairs += [frags ]
187
- num_entries_for_this_frag_pair = 0
187
+ n_entries_for_this_frag_pair = 0
188
188
frag1_entries = self .search_fragment_entries (frags [0 ])
189
189
frag2_entries = self .search_fragment_entries (frags [1 ])
190
190
frag1_charges_found = []
@@ -203,14 +203,14 @@ def fragment_and_process(self, bonds):
203
203
smiles = pb_mol .write ("smi" ).split ()[0 ]
204
204
for charge in self .expected_charges :
205
205
if charge not in frag1_charges_found :
206
- print (f"Missing charge { charge } for fragment { smiles } " )
206
+ print (f"Missing { charge = } for fragment { smiles } " )
207
207
if len (frag2_charges_found ) < len (self .expected_charges ):
208
208
bb = BabelMolAdaptor (frags [1 ].molecule )
209
209
pb_mol = bb .pybel_mol
210
210
smiles = pb_mol .write ("smi" ).split ()[0 ]
211
211
for charge in self .expected_charges :
212
212
if charge not in frag2_charges_found :
213
- print (f"Missing charge { charge } for fragment { smiles } " )
213
+ print (f"Missing { charge = } for fragment { smiles } " )
214
214
# Now we attempt to pair fragments with the right total charge, starting with only fragments with no
215
215
# structural change:
216
216
for frag1 in frag1_entries [0 ]: # 0 -> no structural change
@@ -220,26 +220,26 @@ def fragment_and_process(self, bonds):
220
220
== self .molecule_entry ["final_molecule" ]["charge" ]
221
221
):
222
222
self .bond_dissociation_energies += [self .build_new_entry ([frag1 , frag2 ], bonds )]
223
- num_entries_for_this_frag_pair += 1
223
+ n_entries_for_this_frag_pair += 1
224
224
# If we haven't found the number of fragment pairs that we expect, we expand our search to include
225
225
# fragments that do exhibit structural change:
226
- if num_entries_for_this_frag_pair < len (self .expected_charges ):
226
+ if n_entries_for_this_frag_pair < len (self .expected_charges ):
227
227
for frag1 in frag1_entries [0 ]: # 0 -> no structural change
228
228
for frag2 in frag2_entries [1 ]: # 1 -> YES structural change
229
229
if (
230
230
frag1 ["initial_molecule" ]["charge" ] + frag2 ["initial_molecule" ]["charge" ]
231
231
== self .molecule_entry ["final_molecule" ]["charge" ]
232
232
):
233
233
self .bond_dissociation_energies += [self .build_new_entry ([frag1 , frag2 ], bonds )]
234
- num_entries_for_this_frag_pair += 1
234
+ n_entries_for_this_frag_pair += 1
235
235
for frag1 in frag1_entries [1 ]: # 1 -> YES structural change
236
236
for frag2 in frag2_entries [0 ]: # 0 -> no structural change
237
237
if (
238
238
frag1 ["initial_molecule" ]["charge" ] + frag2 ["initial_molecule" ]["charge" ]
239
239
== self .molecule_entry ["final_molecule" ]["charge" ]
240
240
):
241
241
self .bond_dissociation_energies += [self .build_new_entry ([frag1 , frag2 ], bonds )]
242
- num_entries_for_this_frag_pair += 1
242
+ n_entries_for_this_frag_pair += 1
243
243
244
244
def search_fragment_entries (self , frag ):
245
245
"""
0 commit comments