Skip to content

Commit fa0c31c

Browse files
mjohnson541JacksonBurns
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 ef21b58 commit fa0c31c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

rmgpy/molecule/group.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2955,7 +2955,9 @@ def make_sample_molecule(self):
29552955
'O0sc',
29562956
'P0sc', 'P1sc', 'P1dc', 'P5sc',
29572957
'S0sc', 'S2sc', 'S2dc', 'S2tc', 'S4sc', 'S4dc', 'S4tdc', 'S6sc', 'S6dc', 'S6tdc']
2958-
if group_atom.atomtype[0] in [ATOMTYPES[x] for x in positive_charged] and atom.charge > 0:
2958+
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]):
2959+
pass
2960+
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]):
29592961
pass
29602962
elif atom.charge in group_atom.atomtype[0].charge:
29612963
# declared charge in original group is same as new charge

0 commit comments

Comments
 (0)