Exemplo n.º 1
0
 def test_com_methane(self):
     """The center of mass for methane should be as expected."""
     global tolerance, methane
     expected_com = np.array([0.25] * 3)
     com = cm.center_of_geometry(methane)
     diff = expected_com - com
     assert np.linalg.norm(diff) < tolerance, "com is wrong: \ncom = \n%s, \nexpected = \n%s." % (com, expected_com)
Exemplo n.º 2
0
 def rmsd(self, x, y):
     x = cm.translate(x, -cm.center_of_geometry(x))
     y = cm.translate(y, -cm.center_of_geometry(y))
     rot = cm.rmsd_rotation(x, y)
     y = cm.transform(y, rot)
     return cm.flat_rmsd(x, y)