Skip to content

Commit 89dfb54

Browse files
committed
update_charge skips cutting labels
1 parent 3c640f5 commit 89dfb54

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

rmgpy/molecule/group.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,8 @@ def update_charge(self):
14181418
and radical electrons. This method is used for products of specific families with recipes that modify charges.
14191419
"""
14201420
for atom in self.atoms:
1421+
if isinstance(atom, CuttingLabel):
1422+
continue
14211423
if (len(atom.charge) == 1) and (len(atom.lone_pairs) == 1) and (len(atom.radical_electrons) == 1):
14221424
# if the charge of the group is not labeled, then no charge update will be
14231425
# performed. If there multiple charges are assigned, no update either.

rmgpy/molecule/molecule.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,8 @@ def sort_atoms(self):
12761276
def update_charge(self):
12771277

12781278
for atom in self.atoms:
1279-
atom.update_charge()
1279+
if not isinstance(atom, CuttingLabel):
1280+
atom.update_charge()
12801281

12811282
def update(self, log_species=True, raise_atomtype_exception=True, sort_atoms=True):
12821283
"""

0 commit comments

Comments
 (0)