Skip to content

Commit

Permalink
update adsorbate_shift_up_resonance_structures with double_or_triple …
Browse files Browse the repository at this point in the history
…function
  • Loading branch information
bjkreitz committed Dec 5, 2024
1 parent 1a338a0 commit 35854ef
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions rmgpy/molecule/resonance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,20 +1180,21 @@ def generate_adsorbate_shift_up_resonance_structures(mol):
for atom in mol.vertices:
paths = pathfinder.find_adsorbate_delocalization_paths(atom)
for atom1, atom2, atom3, atom4, bond12, bond23, bond34 in paths:
if (bond12.is_double() and bond23.is_single() and bond34.is_double()) or (bond23.is_double() and bond12.is_double() and bond34.is_double()) or (bond12.is_triple() and bond23.is_single() and bond34.is_triple()) or (bond12.is_triple() and bond23.is_single() and bond34.is_double()):
bond12.decrement_order()
bond23.increment_order()
bond34.decrement_order()
structure = mol.copy(deep=True)
bond12.increment_order()
bond23.decrement_order()
bond34.increment_order()
try:
structure.update_atomtypes(log_species=False)
except AtomTypeError:
pass
else:
structures.append(structure)
if ((bond12.is_double_or_triple() and bond23.is_single() and bond34.is_double_or_triple()) or
(bond12.is_double() and bond23.is_double() and bond34.is_double())):
bond12.decrement_order()
bond23.increment_order()
bond34.decrement_order()
structure = mol.copy(deep=True)
bond12.increment_order()
bond23.decrement_order()
bond34.increment_order()
try:
structure.update_atomtypes(log_species=False)
except AtomTypeError:
pass
else:
structures.append(structure)
return structures


Expand Down

0 comments on commit 35854ef

Please sign in to comment.