-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added ase_atoms_writers in shry/core.py. It can be used instead of ci…
…f_writers()
- Loading branch information
1 parent
11096da
commit 837fb8d
Showing
2 changed files
with
77 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright (c) SHRY Development Team. | ||
# Distributed under the terms of the MIT License. | ||
|
||
""" | ||
Equivalent enumlib operations in SHRY | ||
""" | ||
|
||
from pymatgen.core import Structure | ||
import shry | ||
from shry import Substitutor | ||
|
||
shry.const.DISABLE_PROGRESSBAR = True | ||
|
||
# PbSnTe structure | ||
cif_file = "PbSnTe.cif" | ||
structure = Structure.from_file(cif_file) | ||
structure *= (2, 2, 2) | ||
|
||
# Generate ASE atoms instances with shry | ||
s = Substitutor(structure) | ||
# Shry uses generator; below is to put the Structures into a list | ||
shry_ase_atoms = [x for x in s.ase_atoms_writers()] | ||
shry_num_structs = s.count() | ||
print( | ||
f"SHRY (group equivalent sites) resulted in {shry_num_structs} structures" | ||
) | ||
print(shry_ase_atoms[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters