コード例 #1
0
ファイル: test_feffio.py プロジェクト: georgeyumnam/pymatgen
 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
     pot = FeffPot(struct, 'O')
     d=pot.as_dict()
     pot2 = FeffPot.from_dict(d)
     self.assertEqual(str(pot), str(pot2),
                      "FeffPot to and from dict does not match")
コード例 #2
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
     pot = FeffPot(struct, 'O')
     d = pot.as_dict()
     pot2 = FeffPot.from_dict(d)
     self.assertEqual(str(pot), str(pot2),
                      "FeffPot to and from dict does not match")
コード例 #3
0
ファイル: sets.py プロジェクト: yanguang21/pymatgen
    def get_feff_pot(self, structure, central_atom):
        """
        Creates string representation of potentials used in POTENTIAL file and
        feff.inp.

        Args:
            structure: pymatgen structure object
            central_atom: atom symbol string for absorbing atom

        Returns:
            FeffPot object
        """
        return FeffPot(structure, central_atom)
コード例 #4
0
    def test_get_feffPot(self):
        POT = str(FeffInputSet.get_feff_pot(x, structure, central_atom))
        d, dr = FeffPot.pot_dict_from_string(POT)

        self.assertEqual(d['Co'], 1, "Wrong symbols read in for FeffPot")
コード例 #5
0
ファイル: test_sets.py プロジェクト: dcossey014/pymatgen
    def test_get_feffPot(self):
        POT = str(FeffInputSet.get_feff_pot(x, structure, central_atom))
        d, dr = FeffPot.pot_dict_from_string(POT)

        self.assertEqual(d["Co"], 1, "Wrong symbols read in for FeffPot")
コード例 #6
0
ファイル: test_feffio.py プロジェクト: georgeyumnam/pymatgen
 def test_init(self):
     filepath = os.path.join(test_dir, 'POTENTIALS')
     feffpot = FeffPot.pot_string_from_file(filepath)
     d, dr = FeffPot.pot_dict_from_string(feffpot)
     self.assertEqual(d['Co'], 1, "Wrong symbols read in for FeffPot")
コード例 #7
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'POTENTIALS')
     feffpot = FeffPot.pot_string_from_file(filepath)
     d, dr = FeffPot.pot_dict_from_string(feffpot)
     self.assertEqual(d['Co'], 1, "Wrong symbols read in for FeffPot")