From 093d1739324b62028e2ce8788aee422a1cdcbd22 Mon Sep 17 00:00:00 2001 From: Mattia Soldani Date: Tue, 12 Jan 2021 10:54:05 +0100 Subject: [PATCH] fixing uproot compatibility issues --- setup.py | 4 ++-- succolib/io/root.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 01a5aa3..87a337d 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "2021.1.2" +version = "2021.1.3" setup( author="Mattia Soldani", @@ -18,7 +18,7 @@ "numpy", "pandas", "tqdm", - "uproot>=3.0,<4.0", + "uproot>=4.0", ], license="MIT", classifiers=[ diff --git a/succolib/io/root.py b/succolib/io/root.py index 1678075..4da98f4 100644 --- a/succolib/io/root.py +++ b/succolib/io/root.py @@ -33,7 +33,7 @@ def rootToDfMulti( print("(%d/%d) %s -- descaling fraction: %14.12f" % (i + 1, len(fileIndex), iIndex, descFrac[iIndex])) for iName in tqdm((names)) if (bVerbose & bProgress) else names: # for each value of iIndex, look for all the corresponding files tree = uproot.open(iName)[treeName] - dfTemp0 = tree.pandas.df() + dfTemp0 = tree.arrays(library="pd") dfTemp = dfTemp.append(dfTemp0[dfTemp0.index % int(1 / descFrac[iIndex]) == 0], ignore_index=True, sort=False) # data reshaping: removing the square brackets in the names & remapping all the names according to treeMap