Exemplo n.º 1
0
 def test_cluster_from_file(self):
     r = CifParser(os.path.join(test_dir, "CoO19128.cif"))
     structure = r.get_structures()[0]
     atoms = Atoms(structure, "O", 10.0)
     atoms.write_file("ATOMS_test")
     mol_1 = Atoms.cluster_from_file("ATOMS_test")
     mol_2 = Atoms.cluster_from_file(os.path.join(test_dir, "ATOMS"))
     self.assertEqual(mol_1.formula, mol_2.formula)
     self.assertEqual(len(mol_1), len(mol_2))
     os.remove("ATOMS_test")
Exemplo n.º 2
0
 def test_cluster_from_file(self):
     r = CifParser(os.path.join(test_dir, "CoO19128.cif"))
     structure = r.get_structures()[0]
     atoms = Atoms(structure, "O", 10.0)
     atoms.write_file("ATOMS_test")
     mol_1 = Atoms.cluster_from_file("ATOMS_test")
     mol_2 = Atoms.cluster_from_file(os.path.join(test_dir, "ATOMS"))
     self.assertEqual(mol_1.formula, mol_2.formula)
     self.assertEqual(len(mol_1), len(mol_2))
     os.remove("ATOMS_test")
Exemplo n.º 3
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()