diff --git a/openmmtools/tests/test_utils.py b/openmmtools/tests/test_utils.py index bcfc64db..ba69dac9 100644 --- a/openmmtools/tests/test_utils.py +++ b/openmmtools/tests/test_utils.py @@ -45,6 +45,11 @@ def test_platform_supports_precision(): if supported_precisions != set(['mixed']): raise Exception(f"'CPU' platform should support 'mixed' precision, but platform_supports_precision reports {supported_precisions}") + +def test_string_platform_supports_precision(): + """Test that if we use a string for the platform name, it works""" + assert platform_supports_precision("CPU", "mixed") + # ============================================================================= # TEST STRING MATHEMATICAL EXPRESSION PARSING UTILITIES # ============================================================================= diff --git a/openmmtools/utils.py b/openmmtools/utils.py index 04ff5e24..83523d01 100644 --- a/openmmtools/utils.py +++ b/openmmtools/utils.py @@ -544,10 +544,6 @@ def platform_supports_precision(platform, precision): return precision in ['mixed'] if platform.getName() in ['CUDA', 'OpenCL']: - try: - import openmm - except ImportError: # OpenMM < 7.6 - from simtk import openmm properties = { 'Precision' : precision } system = openmm.System() system.addParticle(1.0) # Cannot create Context on a system with no particles