コード例 #1
0
ファイル: test_ebands.py プロジェクト: Npikeulg/abipy
    def test_read_ebands_from_GSR(self):
        """Read ElectronBands from GSR files."""
        for filename in abidata.GSR_NCFILES:
            ebands = ElectronBands.from_file(filename)
            ebands.to_pymatgen()
            ebands.to_pdframe()

            self.serialize_with_pickle(ebands, test_eq=False)
            ElectronBands.from_dict(ebands.as_dict())
            self.assertMSONable(ebands, test_if_subclass=False)
コード例 #2
0
ファイル: test_ebands.py プロジェクト: Npikeulg/abipy
    def test_read_ebands_from_WFK(self):
        """Read ElectronBands from WFK files."""
        for ii, filename in enumerate(abidata.WFK_NCFILES):
            ebands = ElectronBands.from_file(filename)
            ebands.to_pymatgen()
            ebands.to_pdframe()
            assert ElectronBands.as_ebands(ebands) is ebands

            self.serialize_with_pickle(ebands, test_eq=False)
            ElectronBands.from_dict(ebands.as_dict())
            self.assertMSONable(ebands, test_if_subclass=False)

            if ii == 0:
                if self.has_matplotlib(): ebands.plot(show=False)
                ebands.to_xmgrace(self.get_tmpname(text=True))