コード例 #1
0
 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])
コード例 #2
0
 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))
コード例 #3
0
 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))
コード例 #4
0
 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)
コード例 #5
0
 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)
コード例 #6
0
 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)
コード例 #7
0
ファイル: test_parsedos.py プロジェクト: vorwerkc/excalibr
 def test_energies(self):
     dos = parsedos.dos("testfiles/dos.xml")
     shouldbe = np.array([0, 1, 2]) * factor
     self.assertTrue(np.all(dos.energies == shouldbe))
コード例 #8
0
ファイル: test_parsedos.py プロジェクト: vorwerkc/excalibr
 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))
コード例 #9
0
ファイル: test_parsedos.py プロジェクト: vorwerkc/excalibr
 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))
コード例 #10
0
ファイル: test_parsedos.py プロジェクト: vorwerkc/excalibr
 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))
コード例 #11
0
ファイル: test_parsedos.py プロジェクト: vorwerkc/excalibr
 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))