cleverly.validation.ReplicationCheckpoint#

class cleverly.validation.ReplicationCheckpoint(*args, **kwargs)[source]#

Storage that lets an interrupted CoverageStudy resume.

CoverageStudy.run() calls load for every replication before it fits any, and fits only those that return None. It calls save in the worker process as soon as a replication finishes, so a stopped study loses only the fits in flight. When n_jobs is not 1, save therefore runs in another process: an implementation must be picklable and must store outside the process, as DirectoryCheckpoint does.

See also

DirectoryCheckpoint

The implementation that keeps one file per replication.

Methods#

ReplicationCheckpoint.load(replicate: int) → tuple[ReplicationRecord, ...] | ReplicationFailure | None[source]#

Return the stored outcome of replicate, or None when there is none.

Parameters:
replicateint

Index of the replication.

Returns:
tuple of ReplicationRecord, ReplicationFailure or None

The stored outcome, or None.

ReplicationCheckpoint.save(replicate: int, outcome: tuple[ReplicationRecord, ...] | ReplicationFailure) → None[source]#

Store the outcome of replicate.

Parameters:
replicateint

Index of the replication.

outcometuple of ReplicationRecord or ReplicationFailure

What the replication returned.