def get_mindist(self, **kwargs): from pele.angleaxis import MinPermDistAACluster from pele.angleaxis import TransformAngleAxisCluster, MeasureAngleAxisCluster transform = TransformAngleAxisCluster(self.aatopology) measure = MeasureAngleAxisCluster(self.aatopology, transform=transform, permlist=[]) return MinPermDistAACluster(self.aasystem, measure=measure, transform=transform, accuracy=0.1, **kwargs)
class TestAATransform(unittest.TestCase): def setUp(self): self.nrigid = 10 self.topology = RBTopology() self.topology.add_sites([create_water() for _ in range(self.nrigid)]) self.topology.finalize_setup() self.transform = TransformAngleAxisCluster(self.topology) def test_cpp_rotate(self): x0 = np.array([random_aa() for _ in range(2*self.nrigid)]).ravel() aa = random_aa() mx = aa2mx(aa) x0_rotated = x0.copy() self.transform.rotate(x0_rotated, mx) x0_rotated_python = x0.copy() self.transform._rotate_python(x0_rotated_python, mx) assert_arrays_almost_equal(self, x0_rotated, x0_rotated_python) mx_reverse = aa2mx(-aa) self.transform.rotate(x0_rotated, mx_reverse) assert_arrays_almost_equal(self, x0, x0_rotated)
class TestAATransform(unittest.TestCase): def setUp(self): self.nrigid = 10 self.topology = RBTopology() self.topology.add_sites([create_water() for _ in range(self.nrigid)]) self.topology.finalize_setup() self.transform = TransformAngleAxisCluster(self.topology) def test_cpp_rotate(self): x0 = np.array([random_aa() for _ in range(2 * self.nrigid)]).ravel() aa = random_aa() mx = aa2mx(aa) x0_rotated = x0.copy() self.transform.rotate(x0_rotated, mx) x0_rotated_python = x0.copy() self.transform._rotate_python(x0_rotated_python, mx) assert_arrays_almost_equal(self, x0_rotated, x0_rotated_python) mx_reverse = aa2mx(-aa) self.transform.rotate(x0_rotated, mx_reverse) assert_arrays_almost_equal(self, x0, x0_rotated)
def setUp(self): self.nrigid = 10 self.topology = RBTopology() self.topology.add_sites([create_water() for _ in range(self.nrigid)]) self.topology.finalize_setup() self.transform = TransformAngleAxisCluster(self.topology)