workspace
workspace
#
The ambient workspace a body runs in, and the holds keeping a value's files alive.
active_workspace = ContextVar('cg_active_workspace', default=None)
module-attribute
#
The live workspace of the recipe call running in this context, if any.
allocate(cls, suffix)
#
A cls value at a fresh, not-yet-existing path in the ambient workspace.
Outside any call, a workspace is opened for this value alone and held by it.
Raises:
| Type | Description |
|---|---|
ScratchNotConfigured
|
If no scratch is configured. |
Source code in capturegraph-lib/capturegraph/recipes/values/workspace.py
computing(scratch, key, identity, label)
#
A fresh workspace to compute the call key in, ambient and reported as a step.
The block seals the workspace or loses it: on any exception the workspace is
released, and the exception carries the tail of its exec.log as a note.
Yields:
| Type | Description |
|---|---|
Workspace
|
The workspace the block computes in. |
Source code in capturegraph-lib/capturegraph/recipes/values/workspace.py
exec_log(value)
#
Where a tool run by value logs, or None outside every workspace.
The ambient workspace's log, else that of the workspace value holds.
Source code in capturegraph-lib/capturegraph/recipes/values/workspace.py
pin(value, hold)
#
Keep hold (a workspace or object pin) alive as long as value is.