ROOT Version: 6.26/10
Platform: Ubuntu 22
Compiler: gcc10
PyROOT (Python 3.10.6)
I received a warning when I tried to write a child class from ROOT::RDataFrame
:
RuntimeWarning: class “ROOT::RDataFrame” has no virtual destructor
class MyDataFrame(ROOT.RDataFrame):
Here is a minimal code to reproduce the warning:
import ROOT
class MyDataFrame(ROOT.RDataFrame):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
def define_gamma(self, name: str, speed_cm_per_ns: str):
return (self
.Define('beta', f'{speed_cm_per_ns} / 29.9792458')
.Define(name, '1 / sqrt(1 - beta * beta)')
)
rdf = MyDataFrame('tree', 'example.root')
rdf = rdf.define_gamma('gamma', 'speed')
print(rdf.Mean('gamma').GetValue())
Questions
- Will this warning cause any potential errors such as memory leaks or unexpected crashes?
- Is there a way to properly “fix (hence suppress)” this warning without simply
import warnings
in Python, and ignore it?
Thank you.