The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools. Documentation available at http://open-forcefield-toolkit.readthedocs.io
Version 0.9.0 marks this package's transition from the old openforcefield branding over to its new identity as openff-toolkit. This change has been made to better represent the role of the toolkit, and highlight its place in the larger Open Force Field (OpenFF) ecosystem.
The short version of the changes can be found in the release notes. This post documents some more details that users may find helpful in migrating.
Changes to source code
The import path to the Python module has changed. Replace all instances of openforcefield with openff.toolkit, i.e.
Old (0.8.3 and earlier)
from openforcefield.topology import Molecule
from openforcefield.typing.engines.smirnoff import ForceField
New (0.9.0 and newer)
from openff.toolkit.topology import Molecule
from openff.toolkit.typing.engines.smirnoff import ForceField
Creating a new environment
The name of the conda package has changed to openff-toolkit and is now available on the conda-forge channel. The omnia channel does not need to be in the conda configuration, but it should not cause issues if it is.
See the installation docs, which have been updated, for more details.
Updating an existing conda environment
Creating a new environment is recommended. For users who wish to update an existing environment, it is recommended to first uninstall existing packages:
If writing code that needs to work with the "new" and "old" import paths, consider wrapping the import statement up into a try:/except: block
try:
from openforcefield.topology import Molecule
except ImportError:
from openff.toolkit.topology import Molecule
# Do things with the Molecule API
This type of logic will allow the class to be imported before and after the namespace migration.
Error messages and their solution
ModuleNotFoundError: No module named 'openforcefield'
Update your imports as shown above.
Encountered problems while solving.
Problem: package openff-toolkit-0.9.0-pyh44b312d_0 has constraint openforcefield 9999999999 conflicting with openforcefield-0.8.3-pyh39e3cac_0
Uninstall openforcefield and openforcefields first, then try to install openff-toolkit again.
Version
0.9.0
marks this package's transition from the oldopenforcefield
branding over to its new identity asopenff-toolkit
. This change has been made to better represent the role of the toolkit, and highlight its place in the larger Open Force Field (OpenFF) ecosystem.The short version of the changes can be found in the release notes. This post documents some more details that users may find helpful in migrating.
Changes to source code
The import path to the Python module has changed. Replace all instances of
openforcefield
withopenff.toolkit
, i.e.Old (0.8.3 and earlier)
New (0.9.0 and newer)
Creating a new environment
The name of the conda package has changed to
openff-toolkit
and is now available on theconda-forge
channel. Theomnia
channel does not need to be in the conda configuration, but it should not cause issues if it is.See the installation docs, which have been updated, for more details.
Updating an existing conda environment
Creating a new environment is recommended. For users who wish to update an existing environment, it is recommended to first uninstall existing packages:
and then install the new package:
Safe imports during the migration
If writing code that needs to work with the "new" and "old" import paths, consider wrapping the import statement up into a
try:
/except:
blockThis type of logic will allow the class to be imported before and after the namespace migration.
Error messages and their solution
Update your imports as shown above.
Uninstall
openforcefield
andopenforcefields
first, then try to installopenff-toolkit
again.