io

import qrules.io

Serialization module for the qrules.

The io module provides tools to export or import objects from qrules to and from disk, so that they can be used by external packages, or just to store (cache) the state of the system.

asdict(instance: object)dict[source]
asdot(instance: object, *, render_node: bool = True, render_final_state_id: bool = True, render_resonance_id: bool = False, render_initial_state_id: bool = False, strip_spin: bool = False, collapse_graphs: bool = False)str[source]

Convert a object to a DOT language str.

Only works for objects that can be represented as a graph, particularly a StateTransitionGraph or a list of StateTransitionGraph instances.

fromdict(definition: dict)object[source]
load(filename: str)object[source]
write(instance: object, filename: str)None[source]