Ops
nodekit.concat
¶
Returns a Graph which executes the given sequence of Node | Graph.
In the new Graph, the sequence items' RegisterIds and NodeIds are prepended ids '0', '1', ..., unless ids is given.
nodekit.play
¶
Play the given Graph locally, then return the Trace. If a Node is given, it will be wrapped into a Graph with a single Node.
Parameters:
-
graph(Graph | Node) –The Graph or Node to play.
-
port(int | None, default:None) –The port to connect to.
Returns: The Trace of Events observed during execution.
nodekit.simulate
¶
Deterministically simulates a Graph using the provided Agent. Pointer and keyboard sample events are omitted; only Node start/action/end events are emitted for leaf Nodes.
If no Agent is provided, a DummyAgent is used that randomly selects an available Action in each Node.
Parameters:
Returns:
nodekit.save_graph
¶
Packs the Graph model into a .nkg file, which is the canonical representation of a Graph. A .nkg file is a .zip archive with the following structure:
graph.json assets/ {mime-type-1}/{mime-type-2}/{sha256}.{ext}
nodekit.load_graph
¶
Unpacks a .nkg file from disk and returns the corresponding Graph object. All AssetFiles in the Graph are backed by the asset files in the .nkg archive. The user is responsible for ensuring the .nkg file is not moved or edited while the Graph is in use.
nodekit.open_asset
¶
Streams the bytes of the given Asset.