Skip to content

Commit

Permalink
minor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
stefdoerr committed Sep 12, 2023
1 parent 442945b commit 98e7de4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions moleculekit/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2305,18 +2305,18 @@ def toOpenFFMolecule(self):
from openff.toolkit.topology import Molecule as OFFMolecule
from openff.units import unit

sm = SmallMol(molc, fixHs=False, removeHs=False, _logger=False)
sm = SmallMol(self, fixHs=False, removeHs=False, _logger=False)
sm.assignStereoChemistry(from3D=True)

offmol = OFFMolecule.from_rdkit(sm._mol, hydrogens_are_explicit=True)
offmol.partial_charges = self.charge * unit.e
assert np.array_equal(molc.name, [x.name for x in offmol.atoms])
assert np.array_equal(self.name, [x.name for x in offmol.atoms])
assert np.array_equal(
molc.charge,
self.charge,
[x.m_as(unit.e) for x in offmol.partial_charges],
)
assert np.array_equal(
molc.formalcharge, [x.formal_charge.m_as(unit.e) for x in offmol.atoms]
self.formalcharge, [x.formal_charge.m_as(unit.e) for x in offmol.atoms]
)

return offmol
Expand Down

0 comments on commit 98e7de4

Please sign in to comment.