RDataFrame verbosity level AttributeError

HI! I just tries to increase the RDataFrame verbosity level with the experimental feature by doing:

verbosity = ROOT.Experimental.RLogScopedVerbosity(ROOT.Detail.RDF.RDFLogChannel(), ROOT.Experimental.ELogLevel.kInfo) ´´´
 
And it shows an error: 

``` AttributeError: <namespace cppyy.gbl.Detail at 0x64e3ab8> has no attribute 'RDF'. Full details:
  type object 'Detail' has no attribute 'RDF'
  'Detail::RDF' is not a known C++ class
  'RDF' is not a known C++ template
  'RDF' is not a known C++ enum ´´´

___
_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version: 6.24/06 
_Platform: linuxx8664gcc
_Compiler: (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
___

Hi @imanol097 ,
the invocation is correct (I can run that code fine).

Can you run the corresponding C++ code in the ROOT prompt?
What if you first instantiate an RDF object?

Cheers,
Enrico

Hi @eguiraud ,
The corresponding C++ code runs well in the ROOT prompt.

In Python running the command after loading RDF object gives the same error as before

Hi @imanol097 ,
I can reproduce the problem on lxplus. I am not sure what the cause is, it looks like a bug in PyROOT (cc: @etejedor ).

However if I pick an LCG release instead of the system installation of ROOT things are fine:

[eguiraud@lxplus771 ~]$ python
Python 2.7.5 (default, Nov 16 2020, 22:23:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
>>> verbosity = ROOT.Experimental.RLogScopedVerbosity(ROOT.Detail.RDF.RDFLogChannel(), ROOT.Experimental.ELogLevel.kInfo)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: <namespace cppyy.gbl.Detail at 0x5db9400> has no attribute 'RDF'. Full details:
  type object 'Detail' has no attribute 'RDF'
  'Detail::RDF' is not a known C++ class
  'RDF' is not a known C++ template
  'RDF' is not a known C++ enum
>>>
[eguiraud@lxplus771 ~]$ source /cvmfs/sft.cern.ch/lcg/views/LCG_101/x86_64-centos7-gcc11-opt/setup.sh
[eguiraud@lxplus771 ~]$ python
impoPython 3.9.6 (default, Sep  6 2021, 15:36:22)
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
r>>> import ROOT
>>> verbosity = ROOT.Experimental.RLogScopedVerbosity(ROOT.Detail.RDF.RDFLogChannel(), ROOT.Experimental.ELogLevel.kInfo)

Maybe it’s a Python 2 vs Python 3 thing? It is likely that upgrading to a platform with more recent software will fix this issue, as we typically don’t see the problem on the platforms where we test ROOT.

Cheers,
Enrico

Hello,

You need to do ROOT.ROOT.Detail. instead of ROOT.Detail, since it seems there is a Detail namespace under the global namespace (which does not have the RDF attribute). In such a case, to use ROOT::Detail from PyROOT, you need to do ROOT.ROOT.Detail.

Cheers,
Enric

Thanks @etejedor . It works now.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.