Skip to content

Commit

Permalink
fix atomtype charge checking
Browse files Browse the repository at this point in the history
checks that the first group_atom.atomtype is either an appropriate charged atomtype or is a general version of an appropriate charged atomtype
  • Loading branch information
mjohnson541 authored and ssun30 committed Mar 29, 2024
1 parent 1edc5e0 commit 79d4574
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rmgpy/molecule/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -2993,7 +2993,9 @@ def make_sample_molecule(self):
'O0sc',
'P0sc', 'P1sc', 'P1dc', 'P5sc',
'S0sc', 'S2sc', 'S2dc', 'S2tc', 'S4sc', 'S4dc', 'S4tdc', 'S6sc', 'S6dc', 'S6tdc']
if group_atom.atomtype[0] in [ATOMTYPES[x] for x in positive_charged] and atom.charge > 0:
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]):
pass
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]):
pass
elif atom.charge in group_atom.atomtype[0].charge:
# declared charge in original group is same as new charge
Expand Down

0 comments on commit 79d4574

Please sign in to comment.