How to use pyroot experimental?


how can I “turn on” the experimental version of pyroot based on cppyy? I can’t find relevant doc. If I remember correctly there was a corresponding build option “-D” some time ago but I can’t find the option anymore


_ROOT Version: master or next release
Platform: Not Provided
Compiler: Not Provided

Sorry, that page needs to be updated. The option is -Dpyroot_experimental=ON.

Ok, thanks! Some more related questions:

  1. Is it then enough to just “import ROOT” as with the current pyroot or something else needs to be done?
  2. What is the easier way to test if the new version of pyroot is used?
  3. Is it possible to easily switch between the two pyroot versions or is it necessary to build root two times for this purpose: with and without the -Dpyroot_experimental=ON build option?

It’s probably better to use two different builds of ROOT for the regular and experimental PyROOT. You can probably check the version of cppyy in each of them to decide if you are using the new PyROOT or not. And yes, with the new PyROOT, you just import ROOT as usual.

Ok, thanks a lot! I’ll give it a try.


To check if ROOT has been configured and installed with pyroot experimental one may use shell cmd:
root-config --has-<feature>
root-config --has-pyroot_experimental
which returns yes/no.

Maybe there is also corresponding ROOT c++/python command for this but I couldn’t find it. One may, therefore, use subprocess and define a python function, something like:

import subprocess

def has_pyroot_experimental():
    p1 = subprocess.Popen(['root-config', '--has-pyroot_experimental'], stdout=subprocess.PIPE)

    # Run the command
    output = p1.communicate()[0].strip(b'\n')
    return output == b'yes'

which returns True/False.

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