Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow hcp 4-axes indices as well #390

Merged
merged 5 commits into from
Oct 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyiron_atomistics/atomistics/structure/factories/atomsk.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def create(cls, lattice, a, *species, c=None, hkl=None):
a_and_c = str(a) if c is None else f"{a} {c}"
line = f"--create {lattice} {a_and_c} {' '.join(species)}"
if hkl is not None:
if np.asarray(hkl).shape != (3, 3):
raise ValueError(f"hkl must have shape 3x3 if provided, not {hkl}!")
line += f" orient {' '.join(hkl[0])} {' '.join(hkl[1])} {' '.join(hkl[2])}"
if np.asarray(hkl).shape not in ( (3, 3), (3, 4) ):
raise ValueError(f"hkl must have shape 3x3 or 3x4 if provided, not {hkl}!")
line += "orient" + " ".join("[" + "".join(map(str, a)) + "]" for a in hkl)
# TODO: check len(species) etc. with the document list of supported phases
self._options.append(line)
return self
Expand Down Expand Up @@ -178,7 +178,7 @@ def create(self, lattice, a, *species, c=None, hkl=None):
*species (list of str): chemical short symbols for the type of atoms to create, length depends on lattice
type
c (float, optional): third lattice parameter, only necessary for some lattice types
hkl (array of int, (3,3)): three hkl vectors giving the crystallographic axes that should point along the x,
hkl (array of int, (3,3) or (3,4)): three hkl vectors giving the crystallographic axes that should point along the x,
y, z directions

Returns:
Expand Down