Skip to content

Commit 20dbe27

Browse files
committed
Fixed atomtype charge checking
Now includes checks for negative charges
1 parent cac7251 commit 20dbe27

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rmgpy/molecule/group.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ def is_van_der_waals(self, wildcards=False):
10131013
else:
10141014
return abs(self.order[0]) <= 1e-9 and len(self.order) == 1
10151015

1016-
1016+
10171017
def is_reaction_bond(self, wildcards=False):
10181018
"""
10191019
Return ``True`` if the bond represents a van der Waals bond or ``False`` if
@@ -1851,7 +1851,7 @@ def specify_bond_extensions(self, i, j, basename, r_bonds):
18511851
else:
18521852
atom_type_j_str = atom_type_j[0].label
18531853

1854-
b = None
1854+
b = None
18551855
for v in bdict.keys():
18561856
if abs(v - bd) < 1e-4:
18571857
b = bdict[v]
@@ -2995,6 +2995,8 @@ def make_sample_molecule(self):
29952995
'S0sc', 'S2sc', 'S2dc', 'S2tc', 'S4sc', 'S4dc', 'S4tdc', 'S6sc', 'S6dc', 'S6tdc']
29962996
if atom.charge > 0 and any([group_atom.atomtype[0] is ATOMTYPES[x] or ATOMTYPES[x].is_specific_case_of(group_atom.atomtype[0]) for x in positive_charged]):
29972997
pass
2998+
elif atom.charge < 0 and any([group_atom.atomtype[0] is ATOMTYPES[x] or ATOMTYPES[x].is_specific_case_of(group_atom.atomtype[0]) for x in negative_charged]):
2999+
pass
29983000
elif atom.charge in group_atom.atomtype[0].charge:
29993001
# declared charge in original group is same as new charge
30003002
pass

0 commit comments

Comments
 (0)