PyRuntime#
- class tierkreis.pyruntime.python_runtime.PyRuntime(roots: Iterable[Namespace], num_workers: int = 1)[source]#
Bases:
RuntimeClient
A simplified python-only Tierkreis runtime. Can be used with builtin operations and python only namespaces that are locally available.
Methods
If a callback function is set, call it with an edge and the value on the edge.
Get the signature of functions available on the runtime.
Run a tierkreis graph using the python runtime, and provided inputs.
Set a callback function that takes a TierkreisEdge and TierkreisValue, which will be called every time a edge receives an output.
Type check a tierkreis graph on the runtime against the runtime signature.
type_check_graph_with_inputs
Attributes
Whether the runtime supports type-checking graphs.
- callback(edge: TierkreisEdge, val: TierkreisValue)[source]#
If a callback function is set, call it with an edge and the value on the edge.
- async run_graph(run_g: TierkreisGraph, /, **py_inputs: Any) dict[str, TierkreisValue] [source]#
Run a tierkreis graph using the python runtime, and provided inputs. Returns the outputs of the graph.
- set_callback(callback: Callable[[TierkreisEdge, TierkreisValue], None] | None)[source]#
Set a callback function that takes a TierkreisEdge and TierkreisValue, which will be called every time a edge receives an output. Can be used to inspect intermediate values.
- async type_check_graph(graph: TierkreisGraph) TierkreisGraph [source]#
Type check a tierkreis graph on the runtime against the runtime signature.