openmmforcefields
openmmforcefields copied to clipboard
Allow passing a toolkit registry through to SystemGenerator
The template generators do:
- A lot of
to_smilesandfrom_smilescalls when caching parameters. - 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.
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.
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