def test_attribute_access(self): mol = Geometry(TestGeometry.benzene) # stack coords coords = mol._stack_coords() self.assertEqual(coords.shape, (12, 3)) # elements elements = mol.elements self.assertEqual(len(elements), 12) self.assertEqual(elements[0], "C") # coords coords = mol.coords self.assertEqual(coords.shape, (12, 3))
def test_update_geometry(self): test = Geometry(TestGeometry.benz_NO2_Cl) # using coordinate matrix to update ref = test.copy() ref.coord_shift([-10, 0, 0]) tmp = test._stack_coords() for t in tmp: tmp = tmp - np.array([-10, 0, 0]) test.update_geometry(tmp) self.assertEqual(ref, test) # using file ref.coord_shift([10, 0, 0]) test.update_geometry(TestGeometry.benz_NO2_Cl) self.assertEqual(ref, test)