openmmforcefields icon indicating copy to clipboard operation
openmmforcefields copied to clipboard

Allow passing a toolkit registry through to SystemGenerator

Open IAlibay opened this issue 2 years ago • 2 comments

The template generators do:

  1. A lot of to_smiles and from_smiles calls when caching parameters.
  2. A toolkit dependent openmm system creation call.

It would be great if we could pass through a registry so we can ensure we are consistently creating parameters and writing / reading from cache across multiple environments.

For context: we realised this was an issue where a system we were testing in OpenFE was working fine with RDKit, but kept crashing with environments that had OEChem present. It would be great for us to ensure reproducibility if we just could allow only the rdkit interface to be used by default.

IAlibay avatar Jul 05 '23 13:07 IAlibay

This will be a bit tricky since then we need to store the toolkit used when making the molecule. I understand why this is important.

mikemhenry avatar Jul 05 '23 21:07 mikemhenry

The toolkit has a (⏰ private ⏰) context manager for this sort of behavior: https://github.com/openforcefield/openff-toolkit/blob/0.14.0/openff/toolkit/utils/toolkit_registry.py#L378-L379

mattwthompson avatar Jul 05 '23 22:07 mattwthompson