From 567d74c668768eb99e1ec19d4a4cb187206baeb3 Mon Sep 17 00:00:00 2001 From: "John Chodera (MSKCC)" Date: Sat, 9 May 2015 19:33:17 -0400 Subject: [PATCH] Moved test_openmm_platforms.py to an installed script, accessible via `test-openmm-platforms` from command line. --- README.md | 6 ++++++ examples/platform-tests/README.md | 11 ----------- openmmtools/scripts/__init__.py | 1 + .../scripts/test_openmm_platforms.py | 5 ++++- setup.py | 5 +++-- 5 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 examples/platform-tests/README.md create mode 100644 openmmtools/scripts/__init__.py rename examples/platform-tests/test_platforms.py => openmmtools/scripts/test_openmm_platforms.py (99%) diff --git a/README.md b/README.md index 3185e62d4..b229ad8cc 100644 --- a/README.md +++ b/README.md @@ -16,3 +16,9 @@ OpenMM objects for simulating the desired systems. These classes will also contain the member functions that calculate known analytical properties of these systems, enabling the proper testing. +## `scripts` + +A script that may be useful in testing your OpenMM installation is installed: + +* `test-openmm-platforms` will test the various platforms available to OpenMM to ensure that all systems in `openmmtools.testsystems` give consistent potential energies. +If differences in energies in excess of `ENERGY_TOLERANCE` (default: 0.06 kcal/mol) are detected, these systems will be serialized to XML for further debugging. diff --git a/examples/platform-tests/README.md b/examples/platform-tests/README.md deleted file mode 100644 index bdc763b84..000000000 --- a/examples/platform-tests/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Platform tests - -These scripts run a battery of tests to compare the behavior of the various OpenMM platforms on test systems from `openmmtools.testsystems`. - -To run: -``` -python test_platforms.py -``` -This will compute the potential energy on all available OpenMM platforms and flag failures where the potential energy difference between platforms is greater than `ENERGY_TOLERANCE`, which by default is 0.06 kcal/mol (0.1 kT for T ~ 300 K). - -For systems that fail, the script will serialize these systems out to XML for further study. diff --git a/openmmtools/scripts/__init__.py b/openmmtools/scripts/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/openmmtools/scripts/__init__.py @@ -0,0 +1 @@ + diff --git a/examples/platform-tests/test_platforms.py b/openmmtools/scripts/test_openmm_platforms.py similarity index 99% rename from examples/platform-tests/test_platforms.py rename to openmmtools/scripts/test_openmm_platforms.py index 6da10356f..721b025ed 100644 --- a/examples/platform-tests/test_platforms.py +++ b/openmmtools/scripts/test_openmm_platforms.py @@ -171,7 +171,7 @@ def compute_potential_and_force_by_force_index(system, positions, platform, forc # MAIN AND TESTS #============================================================================================= -if __name__ == "__main__": +def main(): import doctest debug = False # Don't display extra debug information. @@ -302,3 +302,6 @@ def compute_potential_and_force_by_force_index(system, positions, platform, forc sys.exit(1) else: sys.exit(0) + +if __name__ == "__main__": + main() diff --git a/setup.py b/setup.py index 0fe5dc649..f679e2a23 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ DOCLINES = __doc__.split("\n") ######################## -VERSION = "0.9.0" +VERSION = "0.6.2" ISRELEASED = False __version__ = VERSION ######################## @@ -168,12 +168,13 @@ def check_dependencies(): url='https://github.com/choderalab/openmmtools', platforms=['Linux', 'Mac OS-X', 'Unix', 'Windows'], classifiers=CLASSIFIERS.splitlines(), - packages=['openmmtools', "openmmtools.tests"], + packages=['openmmtools', 'openmmtools.tests', 'openmmtools.scripts'], package_dir={'openmmtools': 'openmmtools'}, package_data={'openmmtools': find_package_data('openmmtools/data', 'openmmtools')}, install_requires=['numpy', 'scipy', 'nose'], zip_safe=False, scripts=[], ext_modules=extensions, + entry_points={'console_scripts': ['test-openmm-platforms = openmmtools.scripts.test_openmm_platforms:main']}, ) check_dependencies()