cleverly.validation.ReplicationCheckpoint#
- class cleverly.validation.ReplicationCheckpoint(*args, **kwargs)[source]#
Storage that lets an interrupted
CoverageStudyresume.CoverageStudy.run()callsloadfor every replication before it fits any, and fits only those that returnNone. It callssavein the worker process as soon as a replication finishes, so a stopped study loses only the fits in flight. Whenn_jobsis not 1,savetherefore runs in another process: an implementation must be picklable and must store outside the process, asDirectoryCheckpointdoes.See also
DirectoryCheckpointThe implementation that keeps one file per replication.
Methods#
- ReplicationCheckpoint.load(replicate: int) tuple[ReplicationRecord, ...] | ReplicationFailure | None[source]#
Return the stored outcome of
replicate, orNonewhen there is none.- Parameters:
- replicate
int Index of the replication.
- replicate
- Returns:
tupleofReplicationRecord,ReplicationFailureorNoneThe stored outcome, or
None.
- ReplicationCheckpoint.save(replicate: int, outcome: tuple[ReplicationRecord, ...] | ReplicationFailure) None[source]#
Store the outcome of
replicate.- Parameters:
- replicate
int Index of the replication.
- outcome
tupleofReplicationRecordorReplicationFailure What the replication returned.
- replicate