save_checkpoint

jaxrens.io.checkpoint.save_checkpoint(path, ns_state, symbol_map=None)[source]

Save NS state to HDF5 checkpoint.

Handles any leading batch shape on log_evidence, n_dead, iteration, dead_energies, and dead_positions:

  • SingleRun: all scalar / 1-D — stored as attrs or 1-D datasets.

  • VmapRuns: log_evidence / n_dead / iteration are 1-D (n_runs,) — stored as 1-D datasets.

  • PmapVmapRuns: those fields are (G, P) — stored as 2-D datasets.

The dead_energies slicing [:n_dead] is only applied when n_dead is a scalar (single run). For batched runs the full padded array is saved (callers are expected to slice per-run before saving if space is a concern).

Parameters:
  • path (Path | str) – Path for the checkpoint file.

  • ns_state (dict) – NS state dict from run_ns / run_ns_parallel / run_ns_multi_gpu.

  • symbol_map (dict[int, str] | None) – Optional mapping from type codes to element symbols.

Return type:

None