Skip to content

Commit

Permalink
Test species -> positions mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
sudarsan-surendralal committed Sep 3, 2021
1 parent a30be1e commit 0f09996
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/vasp/test_structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ def test_atoms_from_string(self):
atoms = atoms_from_string(string=lines)
self.assertEqual(atoms.indices.tolist(), [0, 1, 2])
self.assertEqual(" ".join(atoms.get_chemical_symbols()), " ".join(["Ca", "Mg", "Al"]))
self.assertTrue(np.allclose(atoms.positions[atoms.select_index("Ca")],
np.array([6.2262054545, 8.8300000128e-06, 1.9039669849])))
self.assertTrue(np.allclose(atoms.positions[atoms.select_index("Mg")],
np.array([0.3113441054, 0.5391959194, 18.3309003343])))
self.assertTrue(np.allclose(atoms.positions[atoms.select_index("Al")],
np.array([3.1131124744, 5.3920363513, 12.0213927741])))
self.assertIsInstance(atoms, Atoms)

def test_read_atoms(self):
Expand Down

0 comments on commit 0f09996

Please sign in to comment.