File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -301,11 +301,17 @@ def _prune_from_ds(self, node):
301301 else :
302302 valence = valences [- 1 ] - atom .charge
303303 used_electrons += atom .h_count
304+
305+ # count the total number of bound electrons of each atom
304306 bound_electrons = (max (0 , atom .charge ) + atom .h_count
305307 + int (self ._bond_counts [node ])
306308 + int (2 * (self ._bond_counts [node ] % 1 )))
309+
310+ # calculate the number of unpaired electrons of each atom
307311 radical_electrons = (max (0 , VALENCE_ELECTRONS [atom .element ]
308312 - bound_electrons ) % 2 )
313+
314+ # unpaired electrons do not contribute to the aromatic system
309315 free_electrons = valence - used_electrons - radical_electrons
310316
311317 if any (used_electrons == v - atom .charge for v in valences ):
You can’t perform that action at this time.
0 commit comments