zoomy_core.symsolver.restart

zoomy_core.symsolver.restart#

The HDF5 restart file of the Python backends (NumPy, JAX): the march state (time, Q, Qaux) that the templates’ io.save_state / io.load_state pass, global arrays in the mesh’s cell order. h5py is imported only when a file is written or read (NumPy must import under Pyodide).

Module Contents#

Functions#

restart_path

Where the restart file goes: checkpoint, else <output stem>.restart.h5 next to the output (resolved as the output is), else None (no restart file).

missing

FileNotFoundError for a restart file that does not exist, naming the closest sibling.

write_state

Write the march state to path (replaced atomically: a crash keeps the previous file).

check_state

Raise with a clear message unless path is a restart file of this state and mesh.

read_state

(time, Q, Qaux) of a restart file (global arrays).

Data#

API#

zoomy_core.symsolver.restart.FORMAT#

‘zoomy-restart-1’

zoomy_core.symsolver.restart.restart_path(checkpoint, output)#

Where the restart file goes: checkpoint, else <output stem>.restart.h5 next to the output (resolved as the output is), else None (no restart file).

zoomy_core.symsolver.restart.missing(path, what='restart_from')#

FileNotFoundError for a restart file that does not exist, naming the closest sibling.

zoomy_core.symsolver.restart.write_state(path, time, Q, Qaux, names)#

Write the march state to path (replaced atomically: a crash keeps the previous file).

zoomy_core.symsolver.restart.check_state(path, names, n_cells)#

Raise with a clear message unless path is a restart file of this state and mesh.

zoomy_core.symsolver.restart.read_state(path)#

(time, Q, Qaux) of a restart file (global arrays).