Skip to content

Commit

Permalink
Fix generate_adsorbate_conjugate_resonance_structures
Browse files Browse the repository at this point in the history
See discussion at 
#2511 (comment)
Alon pointed out a valid pathway and Bjarne fixed it.
  • Loading branch information
rwest committed Nov 13, 2024
1 parent 6ebe817 commit 38c839a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rmgpy/molecule/resonance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,7 @@ def generate_adsorbate_conjugate_resonance_structures(mol):
for atom in mol.vertices:
paths = pathfinder.find_adsorbate_conjugate_delocalization_paths(atom)
for atom1, atom2, atom3, atom4, atom45, bond12, bond23, bond34, bond45 in paths:
if bond23.is_single():
if (bond12.is_double() or bond12.is_triple()) and (bond34.is_double() or bond34.is_triple()) and (bond45.is_single() or bond45.is_double()):
if (bond12.is_double() or bond12.is_triple()) and (bond23.is_single() or bond23.is_double()) and (bond34.is_double() or bond34.is_triple()) and (bond45.is_single() or bond45.is_double()):
bond12.decrement_order()
bond23.increment_order()
bond34.decrement_order()
Expand All @@ -1229,4 +1228,4 @@ def generate_adsorbate_conjugate_resonance_structures(mol):
pass
else:
structures.append(structure)
return structures
return structures

0 comments on commit 38c839a

Please sign in to comment.