The following code (almost dummy for this example) was working in previous versions of ROOT (6.30.02), but not in a new one (6.32.02). Anybody knows what is going on ? Has the call tp OnPartialResultsSlot been changed? Should the registration of MyPrintEntries proceeed differently ?
Thanks, Juan
def ShowEvolution(self, pos):
# Declare function for printout (just once)
if not ROOT.gROOT.GetGlobalFunction("MyPrintEntries"):
ROOT.gInterpreter.Declare(
"""
void MyPrintEntries(unsigned int iSlot, unsigned long long& iEvent){
return;
}
"""
)
# Set printout per file every nDump processed events
nDump = 10000
self.df[pos].Count().OnPartialResultSlot(nDump,ROOT.MyPrintEntries)
The error is:
self.df[pos].Count().OnPartialResultSlot(nDump,ROOT.MyPrintEntries)
NotImplementedError: ROOT::RDF::RResultPtr<ULong64_t>& ROOT::RDF::RResultPtr<ULong64_t>::OnPartialResultSlot(ULong64_t everyNEvents, function<void(unsigned int,ULong64_t&)> callback) =>
NotImplementedError: could not convert argument 2 (this method cannot (yet) be called)
Thanks for the interesting post and welcome to the ROOT Community!
This seems to be an effect of the new version of cppyy, the interoperability engine behind PyROOT. I add in the loop our expert, @jonas .
I could reproduce this problem, with a simple reproducer. I opened an issue on GitHub so we don’t forget to fix it.
In the meantime, I can suggest you an alternative implementation, where the callback function is defined as a lambda function and passed around on the C++ side: