Skip to content

Commit

Permalink
Spglib 2.4 compatibility: handle TypeError when passing empty cell
Browse files Browse the repository at this point in the history
Some sanity-checking has been added to spglib and now this scenario
leads to a TypeError before the SymmetryDetectionError is reached.
  • Loading branch information
ajjackson committed Apr 18, 2024
1 parent 7608b14 commit 481e8da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion euphonic/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,9 @@ def _recip_space_labels(qpts: np.ndarray,
else:
try:
sym_label_to_coords = seekpath.get_path(cell)["point_coords"]
except SymmetryDetectionError:
except (SymmetryDetectionError, TypeError) as err:
if isinstance(err, TypeError):
assert "positions has to be" in str(err)
warnings.warn(('Could not determine cell symmetry, using generic '
'q-point labels'), stacklevel=2)
sym_label_to_coords = _generic_qpt_labels()
Expand Down

0 comments on commit 481e8da

Please sign in to comment.