Skip to content

Commit

Permalink
Merge pull request #68 from microsoft/store_space_groups
Browse files Browse the repository at this point in the history
store space group info in CIF files
  • Loading branch information
ClaudioZeni authored Feb 20, 2025
2 parents 74b9fca + 4f15b7d commit 087cd53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mattergen/common/utils/eval_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def save_structures(output_path: Path, structures: Sequence[Structure]) -> None:
ase.io.write(output_path / GENERATED_CRYSTALS_EXTXYZ_FILE_NAME, ase_atoms)

with ZipFile(output_path / GENERATED_CRYSTALS_ZIP_FILE_NAME, "w") as zip_obj:
for ix, ase_atom in enumerate(ase_atoms):
ase.io.write(f"/tmp/gen_{ix}.cif", ase_atom, format="cif")
zip_obj.write(f"/tmp/gen_{ix}.cif")
for ix, structure in enumerate(structures):
structure.to(filename=f"/tmp/gen_{ix}.cif", fmt="cif", symprec=0.1)
zip_obj.write(f"/tmp/gen_{ix}.cif", arcname=f"gen_{ix}.cif")
except IOError as e:
print(f"Got error {e} writing the generated structures to disk.")

Expand Down

0 comments on commit 087cd53

Please sign in to comment.