VizRuntime#
- class tierkreis.pyruntime.python_runtime.VizRuntime(url: str, roots: Iterable[Namespace], num_workers: int = 1)[source]#
Bases:
PyRuntime
Child class of
PyRuntime
that can interact with a tierkreis-viz instance for live graph visualization.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.
See
PyRuntime.run_graph
.Set a callback function that takes a TierkreisEdge and TierkreisValue, which will be called every time a edge receives an output.
See
PyRuntime.type_check_graph
.type_check_graph_with_inputs
Send graph to be visualized.
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] #
Run a tierkreis graph using the python runtime, and provided inputs. Returns the outputs of the graph.
- async run_viz_graph(run_g: TierkreisGraph, /, **py_inputs: Any) dict[str, TierkreisValue] [source]#
See
PyRuntime.run_graph
. Additionally updates the visualization with the outputs of each node when they are available.
- set_callback(callback: Callable[[TierkreisEdge, TierkreisValue], None] | None)#
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]#
See
PyRuntime.type_check_graph
. Additionally updates visualized graph with type annotations.
- viz_graph(tg: TierkreisGraph)[source]#
Send graph to be visualized.