Skip to content

Commit

Permalink
Use dataclass interface to spglib symmetry
Browse files Browse the repository at this point in the history
spglib.get_symmetry_dataset now returns a dataclass and throws warnings
on __getitem__.  This affects our Symmetry class when using the .info
attribute.
  • Loading branch information
pmrv committed Aug 27, 2024
1 parent fcb4ade commit e4201d0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions structuretoolkit/analyse/symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Distributed under the terms of "New BSD License", see the LICENSE file.

import ast
import dataclasses
import string
from functools import cached_property
from typing import Optional
Expand Down Expand Up @@ -341,11 +342,11 @@ def info(self):
https://atztogo.github.io/spglib/python-spglib.html
"""
info = spglib.get_symmetry_dataset(
info = dataclasses.asdict(spglib.get_symmetry_dataset(
cell=self._get_spglib_cell(use_magmoms=False),
symprec=self._symprec,
angle_tolerance=self._angle_tolerance,
)
))
if info is None:
raise SymmetryError(spglib.spglib.spglib_error.message)
return info
Expand Down

0 comments on commit e4201d0

Please sign in to comment.