Exemple #1
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 = Potential(struct, 'O')
     d=pot.as_dict()
     pot2 = Potential.from_dict(d)
     self.assertEqual(str(pot), str(pot2),
                      "Potential to and from dict does not match")
Exemple #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 = Potential(struct, 'O')
     d=pot.as_dict()
     pot2 = Potential.from_dict(d)
     self.assertEqual(str(pot), str(pot2),
                      "Potential to and from dict does not match")
Exemple #3
0
 def test_as_dict_and_from_dict(self):
     file_name = os.path.join(PymatgenTest.TEST_FILES_DIR, "HEADER")
     header = Header.from_file(file_name)
     struct = header.struct
     pot = Potential(struct, "O")
     d = pot.as_dict()
     pot2 = Potential.from_dict(d)
     self.assertEqual(str(pot), str(pot2),
                      "Potential to and from dict does not match")
Exemple #4
0
    def potential(self):
        """
        FEFF potential

        Returns:
            Potential
        """
        return Potential(self.structure, self.absorbing_atom)
Exemple #5
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'POTENTIALS')
     feffpot = Potential.pot_string_from_file(filepath)
     d, dr = Potential.pot_dict_from_string(feffpot)
     self.assertEqual(d['Co'], 1, "Wrong symbols read in for Potential")
Exemple #6
0
 def test_get_feffPot(self):
     POT = str(self.mp_xanes.potential)
     d, dr = Potential.pot_dict_from_string(POT)
     self.assertEqual(d["Co"], 1, "Wrong symbols read in for Potential")
Exemple #7
0
 def test_get_feffPot(self):
     POT = str(self.mp_xanes.potential)
     d, dr = Potential.pot_dict_from_string(POT)
     self.assertEqual(d['Co'], 1, "Wrong symbols read in for Potential")
Exemple #8
0
 def test_init(self):
     filepath = os.path.join(test_dir, 'POTENTIALS')
     feffpot = Potential.pot_string_from_file(filepath)
     d, dr = Potential.pot_dict_from_string(feffpot)
     self.assertEqual(d['Co'], 1, "Wrong symbols read in for Potential")
Exemple #9
0
 def test_init(self):
     filepath = os.path.join(PymatgenTest.TEST_FILES_DIR, "POTENTIALS")
     feffpot = Potential.pot_string_from_file(filepath)
     d, dr = Potential.pot_dict_from_string(feffpot)
     self.assertEqual(d["Co"], 1, "Wrong symbols read in for Potential")
Exemple #10
0
 def init_potentials(self):
     if self.is_load_potentials_from_file:
         self._potentials = Potential(struct=self.structure, absorbing_atom=self.absorbing_atom). \
             pot_string_from_file(self.path_to_src_feff_input)
     else:
         self._potentials = Potential(struct=self.structure, absorbing_atom=self.absorbing_atom)
Exemple #11
0
            [1 / 3, 2 / 3, 0.00000],
            [1 / 3, 2 / 3, 0.37780],
        ],
        coords_are_cartesian=False,
        tol=1e-9,
    )
    print(zno_structure)
    print(zno_structure.get_space_group_info())
    out_file_name = '/home/yugin/PycharmProjects/neurons/data/src/feff.inp.new2'
    file_name = '/home/yugin/PycharmProjects/neurons/data/src/feff.inp.old'
    atoms_obj = Atoms(zno_structure, 'O', 12)
    pprint(atoms_obj.struct.cart_coords)
    pprint(atoms_obj.get_lines())

    header_obj = Header(struct=zno_structure)
    pot_obj = Potential(zno_structure, 'O')


    tags_obj = Tags().from_file(filename=file_name)
    pprint(tags_obj.as_dict())

    pot_obj.pot_string_from_file(filename=file_name)
    pprint(pot_obj)
    atoms_obj.atoms_string_from_file(filename=file_name)
    pprint(atoms_obj.as_dict())

    header_obj.write_file(out_file_name)
    tags_obj.write_file(out_file_name)
    pot_obj.write_file(out_file_name)
    atoms_obj.write_file(out_file_name)
    # paths_obj = Paths()