quantlab.factor.kunquant.run_batch_graph#
- quantlab.factor.kunquant.run_batch_graph(name, function, arrays, timestamps, symbols, njobs)[source]#
Compile
functionfor a whole range (throughcompile_graphs) and run it overarrays.For a computation whose inputs do not come from a dataset panel (a factor reading another factor’s store, say). The graph is compiled in the
TSlayout withBATCH_OPTIONS, the symbols padded and cut asFactorKunQuantdoes, and run on the shared executor.- Parameters:
- namestr
The compiled module’s name.
- functionKunQuant.Stage.Function
The graph; its
Inputnames are the keys ofarrays.- arraysdict[str, np.ndarray]
Contiguous float32
[time, symbol]inputs.- timestamps, symbolsnp.ndarray
The axes of the inputs and of the returned panel.
- njobsint
Executor threads.
- Returns:
- xr.Dataset
Every output of the graph on
(timestamp, symbol).
Examples
>>> b = Builder() >>> with b: ... Output(Input("x") * 2.0, "y") >>> run_batch_graph("Double", Function(b.ops), {"x": x}, times, symbols, 2)["y"].shape (3, 8)