Skip to content

Commit 1399f33

Browse files
committed
maint: added cell directions for mirror
1 parent 80cae6d commit 1399f33

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sisl/geometry.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2481,12 +2481,20 @@ def mirror(self, method, atom=None):
24812481
g.xyz[atom, 0] *= -1
24822482
elif method in ['y', 'xz']:
24832483
g.xyz[atom, 1] *= -1
2484+
elif method == 'a':
2485+
method = self.cell[0]
2486+
elif method == 'b':
2487+
method = self.cell[1]
2488+
elif method == 'c':
2489+
method = self.cell[2]
24842490
elif method == 'ab':
24852491
method = cross3(self.cell[0], self.cell[1])
24862492
elif method == 'ac':
24872493
method = cross3(self.cell[0], self.cell[2])
24882494
elif method == 'bc':
24892495
method = cross3(self.cell[1], self.cell[2])
2496+
else:
2497+
raise ValueError(f"{self.__class__.__name__}.mirror unrecognized 'method' value")
24902498

24912499
if not isinstance(method, str):
24922500
# it has to be an array of length 3

0 commit comments

Comments
 (0)