Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-10817

Error when passing PyROOT-wrapped C++ callable to function as std::function argument

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • High
    • Resolution: Unresolved
    • 6.24/00
    • None
    • PyROOT
    • None
    • any

    Description

      The following snippet:

      import ROOT
      ROOT.gInterpreter.Declare("void PrintProgress(ULong64_t e) { std::cout << e << std::endl; }")
      c = ROOT.RDataFrame(1000).Count()
      c.OnPartialResult(10, ROOT.PrintProgress)
      c.GetValue() # run event loop (and PrintProgress every 10 entries)
      

      produces the following error message:

      RDataFrame::Run: event was loop interrupted
      Traceback (most recent call last):
        File "/tmp/foo.py", line 6, in <module>
          c.GetValue() # run event loop (and PrintProgress every 10 entries)
      SystemError: const ULong64_t& ROOT::RDF::RResultPtr<ULong64_t>::GetValue() =>
          SystemError: void ::PrintProgress(ULong64_t e) =>
          SystemError: could not convert argument 1 (../Objects/longobject.c:998: bad argument to internal function)
      

      Attachments

        Activity

          People

            etejedor Enric Tejedor Saavedra
            eguiraud Enrico Guiraud
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: