cstar.simulation.Simulation.restore

Attention

This project is still in an early phase of development.

The python API is not yet stable, and some aspects of the schema for the blueprint and workplan will likely evolve. Therefore whilst you are welcome to try out using the package, we cannot yet guarantee backwards compatibility. We expect to reach a more stable version in 2026.

cstar.simulation.Simulation.restore#

classmethod Simulation.restore(directory: str | Path) Simulation#

Restore a previously saved simulation state.

This method loads a serialized simulation object from the simulation_state.pkl file located in the specified directory and returns the restored instance.

Parameters:

directory (str or Path) – The directory containing the saved simulation state.

Returns:

Simulation – The restored simulation instance.

Raises:
  • FileNotFoundError – If the simulation_state.pkl file is not found in the specified directory.

  • pickle.UnpicklingError – If the file cannot be deserialized, indicating possible corruption.

See also

persist

Saves the current simulation state.