timeflux.core.branch


Branch base class.

branch

class timeflux.core.branch.Branch(graph=None)[source]

Bases: timeflux.core.node.Node

Create instance and initialize the logger.

update(self)[source]
load(self, graph)[source]

Initialize the graph.

Parameters

graph (dict) – The graph.

run(self)[source]

Execute the graph once.

get_port(self, node_id, port_id='o')[source]

Get a port from the graph.

Parameters
  • node_id (string) – The node id.

  • port_id (string) – The port name. Default: o.

Returns

A reference to the requested port.

Return type

Port

set_port(self, node_id, port_id='i', data=None, meta=None, persistent=True)[source]

Set a port’s data and meta.

Parameters
  • node_id (string) – The node id.

  • port_id (string) – The port name. Default: i.

  • data (DataFrame, DataArray) – The data. Default: None.

  • meta (dict) – The meta. Default: None.

  • persistent (boolean) – Set the persistence of data and meta. If True, the port will not be cleared during graph execution. Default: True.