def test_distances(self): atoms_1 = self.atoms.get_lines() distances_1 = [float(a[5]) for a in atoms_1] atoms_2 = Atoms.atoms_string_from_file(os.path.join(test_dir, "ATOMS")) atoms_2 = atoms_2.splitlines()[3:] distances_2 = [float(a.split()[5]) for a in atoms_2] np.testing.assert_allclose(distances_1, distances_2, rtol=1e-5)
def test_distances(self): atoms_1 = self.atoms.get_lines() distances_1 = [float(a[5]) for a in atoms_1] atoms_2 = Atoms.atoms_string_from_file(os.path.join(test_dir, "ATOMS")) atoms_2 = atoms_2.splitlines()[3:] distances_2 = [float(a.split()[5]) for a in atoms_2] np.testing.assert_allclose(distances_1, distances_2)
def test_atoms_from_file(self): filepath = os.path.join(test_dir, 'ATOMS') atoms = Atoms.atoms_string_from_file(filepath) self.assertEqual(atoms.splitlines()[3].split()[4], 'O', "failed to read ATOMS file")
def test_atoms_from_file(self): filepath = os.path.join(PymatgenTest.TEST_FILES_DIR, "ATOMS") atoms = Atoms.atoms_string_from_file(filepath) self.assertEqual(atoms.splitlines()[3].split()[4], "O", "failed to read ATOMS file")
], 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()