teff.checkpoint.from_config¶
teff.checkpoint.from_config
¶
Build a :class:Checkpointer from a declarative {type, ...} config.
Shared by the CLI and a workflow's checkpoint: block so the two never
drift. path/dsn values are taken verbatim; relative path
entries should be resolved against the workflow directory before calling
this (see :func:teff.yaml.checkpointer_from_workflow).
Functions:
| Name | Description |
|---|---|
checkpointer_from_config |
Instantiate a checkpointer from a |
resolve_checkpoint_config |
Return a copy of a |
checkpointer_from_config
¶
checkpointer_from_config(config)
Instantiate a checkpointer from a {type, ...} mapping.
Raises :class:~teff.errors.ConfigError for an unknown type or a
missing required field (e.g. dsn for pg).
Source code in teff/checkpoint/from_config.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
resolve_checkpoint_config
¶
resolve_checkpoint_config(config, base_dir)
Return a copy of a checkpoint: config with relative paths absolved.
Makes path keys relative to base_dir (the workflow directory) so
SQLite/JSON checkpoints land next to the workflow that declares them.
Source code in teff/checkpoint/from_config.py
24 25 26 27 28 29 30 31 32 33 34 | |