Exemplo n.º 1
0
 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")
Exemplo n.º 2
0
 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")
Exemplo n.º 3
0
 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")
Exemplo n.º 4
0
 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")
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
 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")
Exemplo n.º 7
0
 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")