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

Failure when instantiating RDataFrame::Fill

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • 6.26/00
    • None
    • PyROOT
    • None
    • Any

    Description

      The following reproducer, translated from tutorial df005_fillAnyObject, fails to instantiate a template:

      >>> import ROOT
      >>> rdf = ROOT.RDataFrame("myTree", "df005_fillAnyObject.root")
      >>> th1d = rdf.Fill['double'](ROOT.TH1D("th1d", "th1d", 64, 0, 128), ["b1"])
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      TypeError: Could not instantiate Fill<double>:
        Failed to instantiate "Fill<double>(TH1D&,std::initializer_list<std::string>)"
       

      A similar error happens if an std::vector is passed as parameter to specify the columns instead of a Python list:

      >>> import ROOT
      >>> rdf = ROOT.RDataFrame("myTree", "df005_fillAnyObject.root")
      >>> v = ROOT.std.vector['string']()
      >>> v.push_back("b1")
      >>> th1d = rdf.Fill['double'](ROOT.TH1D("th1d", "th1d", 64, 0, 128), v)
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
      TypeError: Could not instantiate Fill<double>:
        Failed to instantiate "Fill<double>(TH1D&,std::vector<string>&)"

      The issue is both in current PyROOT and experimental.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: