Skip to content

Commit

Permalink
Catch symmetry errors in plot.spacegroups
Browse files Browse the repository at this point in the history
  • Loading branch information
pmrv committed Oct 11, 2022
1 parent 6399911 commit aeee335
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pyiron_atomistics/atomistics/structure/structurestorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,10 @@ def get_crystal_system(num):
return "cubic"

def extract(s):
spg = s.get_symmetry(symprec=symprec).spacegroup["Number"]
try:
spg = s.get_symmetry(symprec=symprec).spacegroup["Number"]
except:
spg = 1
return {"space_group": spg, "crystal_system": get_crystal_system(spg)}

return pd.DataFrame(map(extract, self._store.iter_structures()))
Expand Down
3 changes: 2 additions & 1 deletion pyiron_atomistics/atomistics/structure/symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,5 +373,6 @@ def get_ir_reciprocal_mesh(
is_time_reversal=is_time_reversal,
symprec=self._symprec,
)
if mesh is not None:
if mesh is None:
raise SymmetryError(spglib.spglib.spglib_error.message)
return mesh

0 comments on commit aeee335

Please sign in to comment.