openforcefield / openff-toolkit

The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools. Documentation available at http://open-forcefield-toolkit.readthedocs.io
http://openforcefield.org
MIT License
309 stars 90 forks source link

Do not require OpenMM for tests #1683

Closed mattwthompson closed 4 months ago

mattwthompson commented 1 year ago

Some users do not wish to download the CUDA toolkit to do things that don't require it. Much of the toolkit's API has been updated to accommodate this. The testing layer still has OpenMM, baked in, however. It makes sense that you'd want to run tests with OpenMM, but importing anything from openff.toolkit._tests, such as create_ethanol requires OpenMM.

This PR skips tests when OpenMM is required but not installed and also tucks away from heavy OpenMM functions into a separate submodule.

I also noticed a pattern of

which does not need OpenMM to be installed and wastes a small amount of execution time calling Interchange.to_openmm. I didn't fix that here, but I'd like to in the future. I expect this would knock a several seconds off of test runtime.

codecov[bot] commented 1 year ago

Codecov Report

Merging #1683 (f193472) into main (d8e1d7a) will decrease coverage by 0.03%. The diff coverage is 50.00%.

Additional details and impacted files
mattwthompson commented 1 year ago

I no longer need this for my original purpose, so I'm going to strip out a few things. But there are some improvements I'd still like to get across the finish line, so I'm not dumping it. It'll just not get eyes in a week or two, I think.