Commit 75bedabe authored by huangj's avatar huangj
Browse files

Correct the way to compare vector and to do assertAlmostEqual rather than assertEqual.

parent 3d04a92e
...@@ -149,12 +149,15 @@ class TestCharmmFiles(unittest.TestCase): ...@@ -149,12 +149,15 @@ class TestCharmmFiles(unittest.TestCase):
con.setPositions(crd.positions) con.setPositions(crd.positions)
init_coor = con.getState(getPositions=True).getPositions() init_coor = con.getState(getPositions=True).getPositions()
# move the position of the lonepair and recompute its coordinates # move the position of the lonepair and recompute its coordinates
crd.positions[12] = Vec3(0.5, 1.0, 1.5) * angstrom plp=12
crd.positions[plp] = Vec3(0.5, 1.0, 1.5) * angstrom
con.setPositions(crd.positions) con.setPositions(crd.positions)
con.computeVirtualSites() con.computeVirtualSites()
new_coor = con.getState(getPositions=True).getPositions() new_coor = con.getState(getPositions=True).getPositions()
self.assertEqual(init_coor, new_coor) self.assertAlmostEqual(init_coor[plp][0]/nanometers, new_coor[plp][0]/nanometers)
self.assertAlmostEqual(init_coor[plp][1]/nanometers, new_coor[plp][1]/nanometers)
self.assertAlmostEqual(init_coor[plp][2]/nanometers, new_coor[plp][2]/nanometers)
def test_InsCode(self): def test_InsCode(self):
""" Test the parsing of PSF files that contain insertion codes in their residue numbers """ """ Test the parsing of PSF files that contain insertion codes in their residue numbers """
......
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