Skip to content

Commit 1e4bdb9

Browse files
mjohnson541ssun30
authored andcommitted
fix atomtype charge checking
checks that the first group_atom.atomtype is either an appropriate charged atomtype or is a general version of an appropriate charged atomtype
1 parent 426ee43 commit 1e4bdb9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rmgpy/molecule/group.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2993,7 +2993,9 @@ def make_sample_molecule(self):
29932993
'O0sc',
29942994
'P0sc', 'P1sc', 'P1dc', 'P5sc',
29952995
'S0sc', 'S2sc', 'S2dc', 'S2tc', 'S4sc', 'S4dc', 'S4tdc', 'S6sc', 'S6dc', 'S6tdc']
2996-
if group_atom.atomtype[0] in [ATOMTYPES[x] for x in positive_charged] and atom.charge > 0:
2996+
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]):
2997+
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]):
29972999
pass
29983000
elif atom.charge in group_atom.atomtype[0].charge:
29993001
# declared charge in original group is same as new charge

0 commit comments

Comments
 (0)