Skip to content

Commit

Permalink
Merge pull request #533 from viljarjf/speedup-miller-rotation
Browse files Browse the repository at this point in the history
Avoid expensive deepcopy when rotating Miller
  • Loading branch information
hakonanes authored Dec 15, 2024
2 parents 0daa809 + c3a4dda commit 8ac149f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions orix/quaternion/rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,9 @@ def __mul__(
return Q
if isinstance(other, Vector3d):
v = Quaternion(self) * other
improper = (self.improper * np.ones(other.shape)).astype(bool)
v[improper] = -v[improper]
if np.any(self.improper):
improper = (self.improper * np.ones(other.shape)).astype(bool)
v[improper] = -v[improper]
return v
if isinstance(other, int) or isinstance(other, list): # abs(1)
other = np.atleast_1d(other).astype(int)
Expand Down

0 comments on commit 8ac149f

Please sign in to comment.