Skip to content

Commit

Permalink
incorporate review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
bjkreitz authored and rwest committed Nov 13, 2024
1 parent eb0eab9 commit d659cf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rmgpy/molecule/pathfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,4 +530,4 @@ def find_adsorbate_conjugate_delocalization_paths(atom1):
if atom5.is_surface_site():
path.append([atom1, atom2, atom3, atom4, atom5, bond12, bond23, bond34, bond45])

return path
return path
11 changes: 6 additions & 5 deletions rmgpy/molecule/resonance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1133,8 +1133,8 @@ def _clar_transformation(mol, aromatic_ring):
def generate_adsorbate_shift_down_resonance_structures(mol):
"""
Generate all of the resonance structures formed by the shift a pi bond between two C-C atoms to both X-C bonds.
Example XCXCH: [X]C=C=[X] <=> [X]=CC#[X]
(where '=' denotes a double bond, '#' denotes a triple bond)
Example XCHXCH: [X]C=C[X] <=> [X]=CC=[X]
(where '=' denotes a double bond)
"""
cython.declare(structures=list, paths=list, index=cython.int, structure=Graph)
cython.declare(atom=Vertex, atom1=Vertex, atom2=Vertex, atom3=Vertex, atom4=Vertex, bond12=Edge, bond23=Edge, bond34=Edge)
Expand All @@ -1143,11 +1143,10 @@ def generate_adsorbate_shift_down_resonance_structures(mol):
structures = []
if mol.is_multidentate():
for atom in mol.vertices:
# print(atom)
paths = pathfinder.find_adsorbate_delocalization_paths(atom)
for atom1, atom2, atom3, atom4, bond12, bond23, bond34 in paths:
if bond23.is_single():
pass
continue
else:
bond12.increment_order()
bond23.decrement_order()
Expand All @@ -1164,11 +1163,12 @@ def generate_adsorbate_shift_down_resonance_structures(mol):
structures.append(structure)
return structures


def generate_adsorbate_shift_up_resonance_structures(mol):
"""
Generate all of the resonance structures formed by the shift of two electrons from X-C bonds to increase the bond
order between two C-C atoms by 1.
Example XCXCH: [X]=CC#[X] <=> [X]C=C=[X]
Example XCHXCH: [X]=CC=[X] <=> [X]C=C[X]
(where '=' denotes a double bond, '#' denotes a triple bond)
"""
cython.declare(structures=list, paths=list, index=cython.int, structure=Graph)
Expand Down Expand Up @@ -1196,6 +1196,7 @@ def generate_adsorbate_shift_up_resonance_structures(mol):
structures.append(structure)
return structures


def generate_adsorbate_conjugate_resonance_structures(mol):
"""
Generate all of the resonance structures formed by the shift of two electrons in a conjugated pi bond system of
Expand Down

0 comments on commit d659cf9

Please sign in to comment.