otp.Source.render#

Source.render(**kwargs)#

Renders a calculation graph using the graphviz library. Every node is the onetick query language event processor. Nodes in nested queries, first stage queries and eval queries are not shown. Could be useful for debugging and in jupyter to learn the underlying graph.

Note that it’s required to have graphviz package installed.

Examples

>>> data = otp.Ticks(X=[1, 2, 3])
>>> data1, data2 = data[(data['X'] > 2)]
>>> data = otp.merge([data1, data2])
>>> data.render()  
digraph {
	"0x2cd0802d280" [label=PASSTHROUGH
]
	"0x2cc8bbcad60" [label="MERGE(identify_input_ts=False)
"]
	"0x2cd07ebfe10" [label="WHERE_CLAUSE(where=(X) > (2))
"]
	"0x2cd07ebfe10" -> "0x2cd08015dc0" [headlabel="" taillabel=ELSE]
	"0x2cd08015dc0" [label=PASSTHROUGH
]
	"0x2cd08015dc0" -> "0x2cc8bbcad60" [headlabel="" taillabel=""]
	"0x2cd08015b80" [label=PASSTHROUGH
]
	"0x2cd08015b80" -> "0x2cd07ebfe10" [headlabel="" taillabel=""]
	"0x2cd07ebfe10" -> "0x2cc8bbcad60" [headlabel="" taillabel=IF]
	"0x2cc8bbcad60" -> "0x2cd0802d280" [headlabel="" taillabel=""]
}