Skip to content

Commit

Permalink
Check explicitly for empty cell when handling spglib 2.4 TypeError
Browse files Browse the repository at this point in the history
The "positions has to be" string can also arise from other
inconsistencies in data size, which we might be less happy about.
  • Loading branch information
ajjackson committed Apr 18, 2024
1 parent 162a968 commit 226bf54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions euphonic/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,10 @@ def _recip_space_labels(qpts: np.ndarray,
sym_label_to_coords = seekpath.get_path(cell)["point_coords"]
except (SymmetryDetectionError, TypeError) as err:
if isinstance(err, TypeError):
# There is a particular TypeError we expect to see when the
# unit cell is empty; make sure we do not have some other error
assert "positions has to be" in str(err)
assert len(cell[1]) == 0
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 226bf54

Please sign in to comment.