Skip to content

Commit

Permalink
Bugfix: avoid double counting for O-O oxonium
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoruiDong committed Nov 2, 2023
1 parent d456a7f commit 60b2f91
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rdmc/fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,11 @@ def fix_oxonium_bonds(

mol = mol.Copy()
for miss_bond in oxonium_bonds:
mol.AddBond(*miss_bond, order=BondType.SINGLE)
try:
mol.AddBond(*miss_bond, order=BondType.SINGLE)
except RuntimeError:

Check warning on line 395 in rdmc/fix.py

View check run for this annotation

Codecov / codecov/patch

rdmc/fix.py#L395

Added line #L395 was not covered by tests
# Oxygen may get double counted
continue

Check warning on line 397 in rdmc/fix.py

View check run for this annotation

Codecov / codecov/patch

rdmc/fix.py#L397

Added line #L397 was not covered by tests

# Usually the connected atom is a radical site
# So, update the number of radical electrons afterward
Expand Down

0 comments on commit 60b2f91

Please sign in to comment.