Skip to content

SymmetrizedStructure.to(json) raises TypeError #3018

@janosh

Description

@janosh
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    analysisConcerning pymatgen.analysisbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions