I have implemented a simple callback for OnPartialResult
for RDataFrame. Everything inside a jupyter notebook
ROOT.gInterpreter.Declare(
r"""
void my_callback_(TH1D &h) { std::cerr << (int)h.GetEntries() << std::endl; }
std::function<void(TH1D &)> my_callback = my_callback_;
"""
)
# ...
df = df.Define("zero", "0.")
histo_counting_all = df.Histo1D(("histo_counting_all", "n entries", 1, 0.0, 1.0), "zero")
histo_counting_all.OnPartialResult(10000, ROOT.my_callback)
It works, but the output is printed at the end, not during the processing. Is there a way to force the output to be flushed on the cell output?
ROOT Version: 6.26/10
Platform: Not Provided
Compiler: Not Provided