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

callback

If a callback function is set, call it with an edge and the value on the edge.

get_signature

Get the signature of functions available on the runtime.

run_graph

Run a tierkreis graph using the python runtime, and provided inputs.

run_viz_graph

See PyRuntime.run_graph.

set_callback

Set a callback function that takes a TierkreisEdge and TierkreisValue, which will be called every time a edge receives an output.

type_check_graph

See PyRuntime.type_check_graph.

type_check_graph_with_inputs

viz_graph

Send graph to be visualized.

Attributes

can_type_check

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.

property can_type_check: bool#

Whether the runtime supports type-checking graphs.

async get_signature() Signature#

Get the signature of functions available on the runtime.

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.