def test_missing_cell_file(self): """Check error raised if PDOS given without .cell file""" kwargs = self.read_dos_kwargs.copy() del kwargs['cell_file'] with self.assertRaises(OSError): tdos, pdos = read_dos(**kwargs)
def test_tdos_only(self): kwargs = self.read_dos_kwargs.copy() del kwargs['pdos_file'] del kwargs['cell_file'] tdos, pdos = read_dos(**kwargs) for spin, densities in self.ref_data['dos'].densities.items(): assert_array_almost_equal(tdos.densities[spin], densities) self.assertFalse(pdos)
def test_pdos(self): tdos, pdos = read_dos(**self.read_dos_kwargs) for spin, densities in self.ref_data['dos'].densities.items(): assert_array_almost_equal(tdos.densities[spin], densities) for component, orbital_data in self.ref_data['pdos'].items(): for orbital, dos in orbital_data.items(): for spin, densities in dos.densities.items(): assert_array_almost_equal( pdos[component][orbital].densities[spin], densities)