Skip to content

Commit b28e05a

Browse files
committed
enh: enabled rotating part of the supercell for a Geometry
Signed-off-by: Nick Papior <[email protected]>
1 parent ff8e87d commit b28e05a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sisl/geometry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ def rotate(self, angle, v, origo=None, atom=None, only='abc+xyz', rad=False):
15331533
vn /= fnorm(vn)
15341534

15351535
# Rotate by direct call
1536-
if 'abc' in only:
1536+
if 'a' in only or 'b' in only or 'c' in only:
15371537
sc = self.sc.rotate(angle, vn, rad=rad, only=only)
15381538
else:
15391539
sc = self.sc.copy()

sisl/supercell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,8 @@ def rotate(self, angle, v, only='abc', rad=False):
549549
only : ('abc'), str, optional
550550
only rotate the designated cell vectors.
551551
"""
552-
# flatte => copy
553-
vn = np.asarray(v, dtype=np.float64).flatten()
552+
# flatten => copy
553+
vn = _a.asarrayd(v).flatten()
554554
vn /= fnorm(vn)
555555
q = Quaternion(angle, vn, rad=rad)
556556
q /= q.norm() # normalize the quaternion

0 commit comments

Comments
 (0)