Пример #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
     atoms = Atoms(struct, 'O', radius=10.)
     d = atoms.as_dict()
     atoms2 = Atoms.from_dict(d)
     self.assertEqual(str(atoms), str(atoms2),
                      "Atoms failed to and from dict test")
Пример #2
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
     atoms = Atoms(struct, "O", radius=10.0)
     d = atoms.as_dict()
     atoms2 = Atoms.from_dict(d)
     self.assertEqual(str(atoms), str(atoms2),
                      "Atoms failed to and from dict test")
Пример #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 = Atoms(struct, 'O', radius=10.)
     d = atoms.as_dict()
     atoms2 = Atoms.from_dict(d)
     self.assertEqual(str(atoms), str(atoms2),
                      "Atoms failed to and from dict test")
Пример #4
0
        ],
        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()
    # header_obj.from_file(file_name)
    print()