Skip to content

Commit

Permalink
Merge pull request #390 from pyiron/atomsk4
Browse files Browse the repository at this point in the history
Allow hcp 4-axes indices as well
  • Loading branch information
pmrv committed Oct 22, 2021
2 parents 82b62da + 6dbd30c commit cf03201
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit cf03201

Please sign in to comment.