Skip to content

CheckpointConfig

Bases: Serializable

Bundles MultiProgramRunner's checkpoint/execution-control settings into a single object, reused by every loqs.tools runner that inherits from MultiProgramRunner. item_checkpoint/shot_checkpoint are derived read-only properties (not separate stored fields) computed from whether the corresponding directory is set, since the two were always required to agree with each other.

Parameters:

Name Type Description Default
item_checkpoint_dir str | Path | None

Directory to checkpoint per-item results to. Setting this to a non-None value is what turns on item checkpointing (item_checkpoint); coerced to a Path if given as a str.

None
resume bool

Whether to resume from an existing checkpoint at item_checkpoint_dir rather than starting fresh. Requires item_checkpoint to be set.

False
force_resume bool

Whether to bypass a resume-time mismatch check between this config's own domain-specific parameters and a stored checkpoint's.

False
shot_checkpoint_dir str | Path | None

Directory to checkpoint per-shot results to. Setting this to a non-None value is what turns on shot checkpointing (shot_checkpoint); coerced to a Path if given as a str.

None
keep_shot_results bool

Whether per-shot results are retained (read back from disk) rather than discarded once each item completes. Requires both item_checkpoint and shot_checkpoint to be set.

False
poll_interval float

Polling interval (seconds) used while waiting on dispatched work.

1.0
show_progress bool

Whether to display a progress bar while running.

True
runner_filename str

Filename used for the runner's own on-disk checkpoint state, under item_checkpoint_dir.

'runner.h5'
results_filename str

Filename used for each item's own on-disk shot checkpoint, under shot_checkpoint_dir.

'results.h5'

CheckpointConfig

CheckpointConfig(item_checkpoint_dir: str | Path | None = None, resume: bool = False, force_resume: bool = False, shot_checkpoint_dir: str | Path | None = None, keep_shot_results: bool = False, poll_interval: float = 1.0, show_progress: bool = True, runner_filename: str = 'runner.h5', results_filename: str = 'results.h5') -> None

Attributes

Name Type Value Doc
force_resume bool False
item_checkpoint bool read-only property
item_checkpoint_dir str | pathlib.Path | None None
keep_shot_results bool False
poll_interval float 1.0
results_filename str 'results.h5'
resume bool False
runner_filename str 'runner.h5'
shot_checkpoint bool read-only property
shot_checkpoint_dir str | pathlib.Path | None None
show_progress bool True

decode

Inherited static method from Serializable.decode().


dump

Inherited method from Serializable.dump().


encode

Inherited static method from Serializable.encode().


load

Inherited class method from Serializable.load().


read

Inherited class method from Serializable.read().


serialize_function

Inherited static method from Serializable.serialize_function().


write

Inherited method from Serializable.write().