pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

SymmetrizedStructure.to(json) raises TypeError

Open janosh opened this issue 2 years ago • 0 comments

from pymatgen.analysis.structure_analyzer import SpacegroupAnalyzer
from pymatgen.core import Lattice, Structure

structure = Structure(
    lattice=Lattice.cubic(3),
    species=("Fe", "Fe"),
    coords=((0, 0, 0), (0.5, 0.5, 0.5)),
)
symmetrized_structure = SpacegroupAnalyzer(structure).get_symmetrized_structure()
symmetrized_structure.to("dummy.json")

raises

TypeError: Object of type SymmOp is not JSON serializable

janosh avatar May 28 '23 23:05 janosh