-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
60 lines (55 loc) · 1.93 KB
/
Copy path__init__.py
File metadata and controls
60 lines (55 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Spec mapping: this package implements the checkpointing capability
# from pipeline-utilities (spec proposal 0008).
# - Public surface satisfies §10.1 (Checkpointer Protocol),
# §10.2 (record types), §10.10 (error categories).
# - Save fires at completed events for outermost-graph + subgraph-
# internal + fan-out nodes per §10.3.
# - Resume via ``invoke(resume_invocation=...)`` restores per §10.4.
"""openarmature.checkpoint — checkpointing capability.
Public surface: the typed :class:`Checkpointer` Protocol,
:class:`CheckpointRecord` / :class:`NodePosition` /
:class:`CheckpointSummary` shapes, the checkpoint error categories,
and two reference backends (in-memory and SQLite).
Users register a backend at graph build time via
``GraphBuilder.with_checkpointer(...)``; the engine then fires saves
at every ``completed`` event for outermost-graph nodes and
subgraph-internal nodes, and ``invoke(resume_invocation=X)`` loads +
restores from a prior record.
"""
from .backends import InMemoryCheckpointer, SerializationMode, SQLiteCheckpointer
from .errors import (
CheckpointError,
CheckpointNotFound,
CheckpointRecordInvalid,
CheckpointSaveFailed,
CheckpointStateMigrationChainAmbiguous,
CheckpointStateMigrationFailed,
CheckpointStateMigrationMissing,
)
from .migration import MigrationRegistry, StateMigration
from .protocol import (
Checkpointer,
CheckpointFilter,
CheckpointRecord,
CheckpointSummary,
NodePosition,
)
__all__ = [
"CheckpointError",
"CheckpointFilter",
"CheckpointNotFound",
"CheckpointRecord",
"CheckpointRecordInvalid",
"CheckpointSaveFailed",
"CheckpointStateMigrationChainAmbiguous",
"CheckpointStateMigrationFailed",
"CheckpointStateMigrationMissing",
"CheckpointSummary",
"Checkpointer",
"InMemoryCheckpointer",
"MigrationRegistry",
"NodePosition",
"SQLiteCheckpointer",
"SerializationMode",
"StateMigration",
]