Commit 85494077 authored by peastman's avatar peastman
Browse files

Merge pull request #775 from rmcgibbo/message

.message -> str()
parents 7cdeded0 1d450fd8
...@@ -6,7 +6,7 @@ import sys ...@@ -6,7 +6,7 @@ import sys
class TestingError(Exception): class TestingError(Exception):
""" """
An error is encountered when An error is encountered when
""" """
pass pass
...@@ -16,7 +16,7 @@ try: ...@@ -16,7 +16,7 @@ try:
from simtk.unit import * from simtk.unit import *
except ImportError as err: except ImportError as err:
simtk_import_failed = True simtk_import_failed = True
simtk_import_error = err.message simtk_import_error = str(err)
else: else:
simtk_import_failed = False simtk_import_failed = False
...@@ -59,9 +59,9 @@ def run_tests(): ...@@ -59,9 +59,9 @@ def run_tests():
pdb = PDBFile(os.path.join(data_dir, 'test.pdb')) pdb = PDBFile(os.path.join(data_dir, 'test.pdb'))
forcefield = ForceField('amber99sb.xml', 'tip3p.xml') forcefield = ForceField('amber99sb.xml', 'tip3p.xml')
system = forcefield.createSystem(pdb.topology, nonbondedMethod=PME, nonbondedCutoff=1*nanometer, constraints=HBonds) system = forcefield.createSystem(pdb.topology, nonbondedMethod=PME, nonbondedCutoff=1*nanometer, constraints=HBonds)
# List all installed platforms and compute forces with each one. # List all installed platforms and compute forces with each one.
numPlatforms = Platform.getNumPlatforms() numPlatforms = Platform.getNumPlatforms()
print("There are", numPlatforms, "Platforms available:") print("There are", numPlatforms, "Platforms available:")
print() print()
...@@ -80,15 +80,15 @@ def run_tests(): ...@@ -80,15 +80,15 @@ def run_tests():
except: except:
print("- Error computing forces with", platform.getName(), "platform") print("- Error computing forces with", platform.getName(), "platform")
platformErrors[platform.getName()] = sys.exc_info()[1] platformErrors[platform.getName()] = sys.exc_info()[1]
# Give details of any errors. # Give details of any errors.
for platform in platformErrors: for platform in platformErrors:
print() print()
print("%s platform error: %s" % (platform, platformErrors[platform])) print("%s platform error: %s" % (platform, platformErrors[platform]))
# See how well the platforms agree. # See how well the platforms agree.
if numPlatforms > 1: if numPlatforms > 1:
print() print()
print("Median difference in forces between platforms:") print("Median difference in forces between platforms:")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment