From 668fe804a7641f166b918c70b0e8eafcc673dc43 Mon Sep 17 00:00:00 2001 From: Pratyush Das Date: Thu, 28 Mar 2019 11:56:46 +0530 Subject: [PATCH 1/4] Write histogram read by uproot --- uproot_methods/convert.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/uproot_methods/convert.py b/uproot_methods/convert.py index 55d0cd2..e9e35e7 100644 --- a/uproot_methods/convert.py +++ b/uproot_methods/convert.py @@ -58,6 +58,9 @@ def types(cls, obj): elif any(x == ("uproot_methods.classes.TH1", "Methods") for x in types(obj.__class__, obj)): return (None, None, "uproot.write.objects.TH1", "TH1") + elif any(x == ("TH1", "Methods") for x in types(obj.__class__, obj)): + return (None, None, "uproot.write.objects.TH1", "TH1") + else: raise TypeError("type {0} from module {1} is not writeable by uproot".format(obj.__class__.__name__, obj.__class__.__module__)) From ae229ba34a3d48e9bb376c1a217a8f4c2abef46a Mon Sep 17 00:00:00 2001 From: Pratyush Das Date: Thu, 28 Mar 2019 17:49:40 +0530 Subject: [PATCH 2/4] Write histograms from ROOT files read by uproot --- uproot_methods/convert.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/uproot_methods/convert.py b/uproot_methods/convert.py index 01d5f00..77d4718 100644 --- a/uproot_methods/convert.py +++ b/uproot_methods/convert.py @@ -61,10 +61,7 @@ def types(cls, obj): elif any(x == ("physt.histogram1d", "Histogram1D") for x in types(obj.__class__, obj)): return ("uproot_methods.classes.TH1", "from_physt", "uproot.write.objects.TH1", "TH1") - elif any(x == ("uproot_methods.classes.TH1", "Methods") for x in types(obj.__class__, obj)): - return (None, None, "uproot.write.objects.TH1", "TH1") - - elif any(x == ("TH1", "Methods") for x in types(obj.__class__, obj)): + elif any(x == ("uproot_methods.classes.TH1", "Methods") or x == ("TH1", "Methods") for x in types(obj.__class__, obj)): return (None, None, "uproot.write.objects.TH1", "TH1") else: From 70667b2f84c442046825e476aef762eb4e8b8a46 Mon Sep 17 00:00:00 2001 From: Pratyush Das Date: Thu, 28 Mar 2019 19:28:18 +0530 Subject: [PATCH 3/4] Update version.py --- uproot_methods/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uproot_methods/version.py b/uproot_methods/version.py index 1802362..1d03a9f 100644 --- a/uproot_methods/version.py +++ b/uproot_methods/version.py @@ -30,7 +30,7 @@ import re -__version__ = "0.4.4" +__version__ = "0.4.5" version = __version__ version_info = tuple(re.split(r"[-\.]", __version__)) From 1055bba1154782e10d6fa1e993666e7b1718fa3d Mon Sep 17 00:00:00 2001 From: Pratyush Das Date: Sat, 30 Mar 2019 10:19:10 +0530 Subject: [PATCH 4/4] Update version.py --- uproot_methods/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uproot_methods/version.py b/uproot_methods/version.py index 1d03a9f..7740391 100644 --- a/uproot_methods/version.py +++ b/uproot_methods/version.py @@ -30,7 +30,7 @@ import re -__version__ = "0.4.5" +__version__ = "0.4.6" version = __version__ version_info = tuple(re.split(r"[-\.]", __version__))