Skip to content

Commit

Permalink
Fixed atomtype charge checking
Browse files Browse the repository at this point in the history
Now includes checks for negative charges
  • Loading branch information
ssun30 committed May 14, 2024
1 parent cac7251 commit 20dbe27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rmgpy/molecule/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ def is_van_der_waals(self, wildcards=False):
else:
return abs(self.order[0]) <= 1e-9 and len(self.order) == 1


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

b = None
b = None
for v in bdict.keys():
if abs(v - bd) < 1e-4:
b = bdict[v]
Expand Down Expand Up @@ -2995,6 +2995,8 @@ def make_sample_molecule(self):
'S0sc', 'S2sc', 'S2dc', 'S2tc', 'S4sc', 'S4dc', 'S4tdc', 'S6sc', 'S6dc', 'S6tdc']
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
pass
Expand Down

0 comments on commit 20dbe27

Please sign in to comment.