From 5075f1e16867173a14400453f7395e8b5a5a1e4b Mon Sep 17 00:00:00 2001 From: Ryan Gillis Date: Tue, 8 Oct 2019 09:59:14 -0400 Subject: [PATCH] prevents resonance generation of S#S structures by find_lone_pair_multiplebond_paths and find_adj_lone_pair_multiple_bond_delocalization_paths --- rmgpy/molecule/pathfinder.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/rmgpy/molecule/pathfinder.py b/rmgpy/molecule/pathfinder.py index 36022935db0..d2976fb9cb4 100644 --- a/rmgpy/molecule/pathfinder.py +++ b/rmgpy/molecule/pathfinder.py @@ -292,13 +292,15 @@ def find_lone_pair_multiple_bond_paths(atom1): paths = [] for atom2, bond12 in atom1.edges.items(): - # Bond must be capable of gaining an order - if bond12.is_single() or bond12.is_double(): - for atom3, bond23 in atom2.edges.items(): - # Bond must be capable of losing an order without breaking, atom3 must be able to gain a lone pair - if atom1 is not atom3 and (bond23.is_double() or bond23.is_triple()) \ - and (atom3.is_carbon() or is_atom_able_to_gain_lone_pair(atom3)): - paths.append([atom1, atom2, atom3, bond12, bond23]) + #if both atom1 and atom2 are sulfur then don't do this type of resonance + if not atom1.is_sulfur() or not atom2.is_sulfur(): + # Bond must be capable of gaining an order + if bond12.is_single() or bond12.is_double(): + for atom3, bond23 in atom2.edges.items(): + # Bond must be capable of losing an order without breaking, atom3 must be able to gain a lone pair + if atom1 is not atom3 and (bond23.is_double() or bond23.is_triple()) \ + and (atom3.is_carbon() or is_atom_able_to_gain_lone_pair(atom3)): + paths.append([atom1, atom2, atom3, bond12, bond23]) return paths @@ -382,7 +384,7 @@ def find_adj_lone_pair_multiple_bond_delocalization_paths(atom1): # Find paths in the direction the bond order, # atom1 must posses at least one lone pair to loose it if ((bond12.is_single() or bond12.is_double()) - and is_atom_able_to_lose_lone_pair(atom1)): + and is_atom_able_to_lose_lone_pair(atom1)) and not (atom1.is_sulfur() and atom2.is_sulfur() and bond12.is_double()): #the final clause of this prevents S#S from forming by this resonance pathway paths.append([atom1, atom2, bond12, 1]) # direction = 1 # Find paths in the direction the bond order, # atom1 gains a lone pair, hence cannot already have more than two lone pairs