OpenBabel energy minimization fails if Compound.name does not contain an element symbol
chrisiacovella opened this issue · 0 comments
chrisiacovella commented
Bug summary
The way energy minimization is currently handled, it relies on outputting a temporary .mol2 file. This .mol2 file populates fields solely using Compound.name info, and not Compound.element. While the energy_minimize function does check if Compound.element is not set and tries to infer the element, the element information is not used.
Code to reproduce the behavior
Please include a code snippet that can be used to reproduce this bug.
import mbuild as mb
from mbuild.lib.recipes.alkane import Alkane
test_mol = Alkane(n=6)
for particle in test_mol: particle.name = 'junk'
test_mol.energy_minimize()
Software versions
- Which version of mBuild are you using? 0.15.1
- Which version of Python (
python --version
)? 3.9 - Which operating system? MacOS 12.6.2 M1 chip