From 9a259592dd8d67f492086f0161a534f2aec55425 Mon Sep 17 00:00:00 2001 From: Jim Pivarski Date: Thu, 27 Sep 2018 15:38:03 -0500 Subject: [PATCH] fix special case of handling TLorentzVector -> TVector3 with non-jagged arrays --- uproot_methods/classes/TLorentzVector.py | 8 ++++---- uproot_methods/version.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/uproot_methods/classes/TLorentzVector.py b/uproot_methods/classes/TLorentzVector.py index 05eb8f2..99f15e9 100644 --- a/uproot_methods/classes/TLorentzVector.py +++ b/uproot_methods/classes/TLorentzVector.py @@ -166,9 +166,9 @@ def _initObjectArray(self, table): def p3(self): out = self.empty_like(generator=lambda row: uproot_methods.classes.TVector3.TVector3(row["fX"], row["fY"], row["fZ"])) if isinstance(self, awkward.JaggedArray): - out.__class__ = type("JaggedArray", (awkward.JaggedArray, uproot_methods.classes.TVector3.ArrayMethods), {}) + out.__class__ = type("JaggedArrayMethods", (awkward.JaggedArray, uproot_methods.classes.TVector3.ArrayMethods), {}) else: - out.__class__ = uproot_methods.classes.TVector3.ArrayMethods + out.__class__ = type("ObjectArrayMethods", (awkward.ObjectArray, uproot_methods.classes.TVector3.ArrayMethods), {}) out["fX"] = self.x out["fY"] = self.y out["fZ"] = self.z @@ -216,9 +216,9 @@ def unit(self): def boostp3(self): out = self.empty_like(generator=lambda row: uproot_methods.classes.TVector3.TVector3(row["fX"], row["fY"], row["fZ"])) if isinstance(self, awkward.JaggedArray): - out.__class__ = type("JaggedArray", (awkward.JaggedArray, uproot_methods.classes.TVector3.ArrayMethods), {}) + out.__class__ = type("JaggedArrayMethods", (awkward.JaggedArray, uproot_methods.classes.TVector3.ArrayMethods), {}) else: - out.__class__ = uproot_methods.classes.TVector3.ArrayMethods + out.__class__ = type("ObjectArrayMethods", (awkward.ObjectArray, uproot_methods.classes.TVector3.ArrayMethods), {}) out["fX"] = self.x / self.t out["fY"] = self.y / self.t out["fZ"] = self.z / self.t diff --git a/uproot_methods/version.py b/uproot_methods/version.py index cbef332..aa60722 100644 --- a/uproot_methods/version.py +++ b/uproot_methods/version.py @@ -30,7 +30,7 @@ import re -__version__ = "0.2.1" +__version__ = "0.2.2" version = __version__ version_info = tuple(re.split(r"[-\.]", __version__))