Skip to content

Commit

Permalink
incorporate review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
bjkreitz committed Jul 17, 2024
1 parent 06ef6b1 commit 271fe7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rmgpy/molecule/pathfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,4 +533,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
13 changes: 7 additions & 6 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 @@ -1144,11 +1144,10 @@ def generate_adsorbate_shift_down_resonance_structures(mol):

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 @@ -1165,11 +1164,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 @@ -1198,6 +1198,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 Expand Up @@ -1231,4 +1232,4 @@ def generate_adsorbate_conjugate_resonance_structures(mol):
pass
else:
structures.append(structure)
return structures
return structures

0 comments on commit 271fe7e

Please sign in to comment.