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.Tick(X=3)
>>> data1, data2 = data[(data['X'] > 2)]
>>> data = otp.merge([data1, data2])
>>> data.render()  
digraph {
	"0x19909e35630" [label=PASSTHROUGH
]
	"0x19909e3c140" [label="MERGE(identify_input_ts=False)
"]
	"0x19909dcb5f0" [label="WHERE_CLAUSE(where=(X) > (2))
"]
	"0x19909dcb5f0" -> "0x19909e40040" [headlabel="" taillabel=ELSE]
	"0x19909e40040" [label=PASSTHROUGH
]
	"0x19909e40040" -> "0x19909e3c140" [headlabel="" taillabel=""]
	"0x19909e35e80" [label=PASSTHROUGH
]
	"0x19909d428b0" [label="TICK_GENERATOR(bucket_interval=0,bucket_time=BUCKET_START,fields=long X=3)
tick_types=[DEMO_L1::TICK_GENERATOR]
"]
	"0x19909d428b0" -> "0x19909e35e80" [headlabel="" taillabel=""]
	"0x19909e35e80" -> "0x19909dcb5f0" [headlabel="" taillabel=""]
	"0x19909dcb5f0" -> "0x19909e3c140" [headlabel="" taillabel=IF]
	"0x19909e3c140" -> "0x19909e35630" [headlabel="" taillabel=""]
}