示例#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")
 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")
示例#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")
示例#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")
示例#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:
                structure object
            central_atom:
                symbol for absorbing atom

        Returns:
            String representation of atoms file.
        """
        atoms = FeffAtoms(structure, central_atom)
        return atoms.get_string()
示例#6
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)
示例#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")
 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")