ryvencore.Flow module - ryvencore v0.1.0 documentation

Hide navigation sidebar
Hide table of contents sidebar
Toggle table of contents sidebar

# ryvencore.Flow module

class Flow(session, script)

  Bases: `ryvencore.Base.Base`

  Manages all abstract flow components (nodes, connections) and includes implementations for editing.

  node_added = <ryvencore.Base.Event object>
  node_removed = <ryvencore.Base.Event object>
  connection_added = <ryvencore.Base.Event object>
  connection_removed = <ryvencore.Base.Event object>
  connection_request_valid = <ryvencore.Base.Event object>
  nodes_created_from_data = <ryvencore.Base.Event object>
  connections_created_from_data = <ryvencore.Base.Event object>
  algorithm_mode_changed = <ryvencore.Base.Event object>
  load(data)

    Loading a flow from data

  create_nodes_from_data(nodes_data: List)

    Creates Nodes from nodes_data, previously returned by data()

  create_node(node_class, data=None)

    Creates, adds and returns a new node object

  add_node(node: ryvencore.Node.Node)

    Stores a node object and causes the node’s place_event()

  node_view_placed(node: ryvencore.Node.Node)

    Triggered after the node’s GUI content has been fully initialized

  remove_node(node: ryvencore.Node.Node)

    Removes a node from internal list without deleting it

  connect_nodes_from_data(nodes: List[ryvencore.Node.Node], data: List)
  check_connection_validity(p1: ryvencore.NodePort.NodePort, p2: ryvencore.NodePort.NodePort) → bool

    Checks whether a considered connect action is legal

  connect_nodes(p1: ryvencore.NodePort.NodePort, p2: ryvencore.NodePort.NodePort) → ryvencore.Connection.Connection

    Connects nodes or disconnects them if they are already connected

  add_connection(c: ryvencore.Connection.Connection)

    Adds a connection object

  remove_connection(c: ryvencore.Connection.Connection)

    Removes a connection object without deleting it

  algorithm_mode() → str

    Returns the current algorithm mode of the flow as string

  set_algorithm_mode(mode: str)

    Sets the algorithm mode of the flow, possible values are ‘data’ and ‘exec’

  flow_changed()
  data() → dict

    converts the object to a JSON compatible dict for serialization

  gen_nodes_data(nodes: List[ryvencore.Node.Node]) → List[dict]
  gen_conns_data(nodes: List[ryvencore.Node.Node]) → List[dict]