def test_get_string(self): header = Header.from_string(HeaderTest.header_string) struc = header.struct central_atom = 'O' a = FeffAtoms(struc, central_atom) atoms = a.get_string() self.assertEqual(atoms.splitlines()[3].split()[4], central_atom, "failed to create ATOMS string")
def test_as_dict_and_from_dict(self): file_name = os.path.join(test_dir, 'HEADER') header = Header.from_file(file_name) struct = header.struct atoms = FeffAtoms(struct, 'O') d = atoms.as_dict() atoms2 = FeffAtoms.from_dict(d) self.assertEqual(str(atoms), str(atoms2), "FeffAtoms failed to and from dict test")
def get_feff_atoms(self, structure, central_atom): """ Creates string representation of atomic shell coordinates using in ATOMS file and feff.inp. Args: structure: pymatgen structure object central_atom: atom symbol string for absorbing atom Returns: FeffAtoms object """ return FeffAtoms(structure, central_atom)
def test_init(self): filepath = os.path.join(test_dir, 'ATOMS') atoms = FeffAtoms.atoms_string_from_file(filepath) self.assertEqual(atoms.splitlines()[3].split()[4], 'O', "failed to read ATOMS file")