def test_atoml(self): dos = parsedos.dos("testfiles/dos_diamond.xml") for l in [0, 1, 2, 3]: # test whether shapes are identical self.assertTrue(np.all(dos.atoml(1, 1, l).shape == atoml[l].shape)) # test whether all entries are (almost) the same np.testing.assert_almost_equal(dos.atoml(1, 1, l), atoml[l])
def test_total(self): dos = parsedos.dos("testfiles/dos.xml") shouldbe = np.array([101, 102, 103]).astype(np.float) self.assertTrue(np.all(dos.total() == shouldbe))
def test_specieslm(self): dos = parsedos.dos("testfiles/dos.xml") shouldbe = np.array([3, 4, 5]).astype(np.float) self.assertTrue(np.all(dos.specieslm(1, 0, 0) == shouldbe))
def test_atom(self): dos = parsedos.dos("testfiles/dos_diamond.xml") # test whether shapes are identical self.assertTrue(np.all(dos.atom(1, 1).shape == atom.shape)) # test whether all entries are (almost) the same np.testing.assert_almost_equal(dos.atom(1, 1), atom)
def test_energies(self): dos = parsedos.dos("testfiles/dos_diamond.xml") # test whether shapes are identical self.assertTrue(np.all(dos.energies.shape == energies.shape)) # test whether all entries are (almost) the same np.testing.assert_almost_equal(dos.energies, energies)
def test_interstitial(self): dos = parsedos.dos("testfiles/dos_diamond.xml") # test whether shapes are identical self.assertTrue(np.all(dos.interstitial().shape == interstitial.shape)) # test whether all entries are (almost) the same np.testing.assert_almost_equal(dos.interstitial(), interstitial)
def test_energies(self): dos = parsedos.dos("testfiles/dos.xml") shouldbe = np.array([0, 1, 2]) * factor self.assertTrue(np.all(dos.energies == shouldbe))
def test_interstitial(self): dos = parsedos.dos("testfiles/dos.xml") shouldbe = np.array([9, 10, 11]).astype(np.float) self.assertTrue(np.all(dos.interstitial() == shouldbe))
def test_atoml(self): dos = parsedos.dos("testfiles/dos.xml") shouldbe = np.array([6, 7, 8]).astype(np.float) self.assertTrue(np.all(dos.atoml(1, 1, 1) == shouldbe))
def test_speciesl(self): dos = parsedos.dos("testfiles/dos.xml") shouldbe = np.array([12, 14, 16]).astype(np.float) self.assertTrue(np.all(dos.speciesl(1, 1) == shouldbe))
def test_angular(self): dos = parsedos.dos("testfiles/dos.xml") shouldbe = np.array([24, 28, 32]).astype(np.float) self.assertTrue(np.all(dos.angular(1) == shouldbe))