Spaces:
Runtime error
Runtime error
File size: 516 Bytes
a117bb5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
def generate_xyz_text(atoms):
"""
Generate the text content of an XYZ format from a list of atoms.
:param atoms: List of atoms with their symbols and coordinates
:return: XYZ format as a string
"""
xyz_content = f"{len(atoms)}\n"
xyz_content += "XYZ file content generated from atoms_to_greed function\n"
for atom in atoms:
symbol, coordinates = atom
xyz_content += f"{symbol} {coordinates[0]:.3f} {coordinates[1]:.3f} {coordinates[2]:.3f}\n"
return xyz_content |