Skip to content

Commit 697666c

Browse files
committed
Fixed an error in the lo_to_split argumento of DiagonalizeSupercell
1 parent 9415f83 commit 697666c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

cellconstructor/Phonons.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3681,8 +3681,11 @@ def DiagonalizeSupercell(self, verbose = False, lo_to_split = None, return_qmode
36813681
t2 = ForceTensor.Tensor2(self.structure, self.structure.generate_supercell(self.GetSupercell()), self.GetSupercell())
36823682
t2.SetupFromPhonons(self)
36833683

3684-
if lo_to_split.lower() == "random":
3685-
fc_gamma = t2.Interpolate(np.zeros(3))
3684+
if is_instance(lo_to_split, str):
3685+
if lo_to_split.lower() == "random":
3686+
fc_gamma = t2.Interpolate(np.zeros(3))
3687+
else:
3688+
raise ValueError("Error, lo_to_split argument '%s' not recognized" % lo_to_split)
36863689
else:
36873690
fc_gamma = t2.Interpolate(np.zeros(3), q_direct= -lo_to_split)
36883691

0 commit comments

Comments
 (0)