Skip to content

Commit

Permalink
fix TypeError in SpacegroupAnalyzer.get_symmetrized_structure() if sp…
Browse files Browse the repository at this point in the history
…glib returns no symmetries
  • Loading branch information
janosh committed Nov 7, 2022
1 parent 940e9fe commit fb2fc72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pymatgen/symmetry/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ def _get_symmetry(self):
vectors in scaled positions.
"""
d = spglib.get_symmetry(self._cell, symprec=self._symprec, angle_tolerance=self._angle_tol)
if d is None:
return (), ()
# Sometimes spglib returns small translation vectors, e.g.
# [1e-4, 2e-4, 1e-4]
# (these are in fractional coordinates, so should be small denominator
Expand Down

0 comments on commit fb2fc72

Please sign in to comment.