Skip to content

Unable to save state including material #19

@lucashfrancisco

Description

@lucashfrancisco

For hybrid undulators, states cannot be saved because they include a Material object (for the poles) which cannot be serialized. This issue arose when trying to use saved states to avoid the necessity of repeating a solve() execution, as pointed out by @Gabrielrezende-asc.

from imaids.models import HybridPlanar
und = HybridPlanar()
und.save_state('saved_state.json')

Results in:

TypeError: Object of type VanadiumPermendur is not JSON serializable

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions