diff --git a/DQMServices/Components/scripts/dqmiodumpmetadata.py b/DQMServices/Components/scripts/dqmiodumpmetadata.py index feffbc1115e20..c02d6577e030e 100755 --- a/DQMServices/Components/scripts/dqmiodumpmetadata.py +++ b/DQMServices/Components/scripts/dqmiodumpmetadata.py @@ -14,13 +14,13 @@ f = uproot.open(args.filename) things = f.keys() -if b'Indices;1' in things: - indices = f[b'Indices'] - runs = indices.array(b"Run") - lumis = indices.array(b"Lumi") - firstindex = indices.array(b"FirstIndex") - lastindex = indices.array(b"LastIndex") - types = indices.array(b"Type") +if 'Indices;1' in things: + indices = f['Indices'] + runs = indices['Run'].array() + lumis = indices['Lumi'].array() + firstindex = indices['FirstIndex'].array() + lastindex = indices['LastIndex'].array() + types = indices['Type'].array() counts = defaultdict(lambda: 0) for run, lumi, first, last, type in zip(runs, lumis, firstindex, lastindex, types): @@ -54,5 +54,3 @@ def showrow(): else: print("This does not look like DQMIO data.") - - diff --git a/DQMServices/Components/scripts/dqmiolistmes.py b/DQMServices/Components/scripts/dqmiolistmes.py index 9e462a0240708..c03f82db56613 100755 --- a/DQMServices/Components/scripts/dqmiolistmes.py +++ b/DQMServices/Components/scripts/dqmiolistmes.py @@ -19,13 +19,13 @@ f = uproot.open(args.filename) things = f.keys() -if b'Indices;1' in things: - indices = f[b'Indices'] - runs = indices.array(b"Run") - lumis = indices.array(b"Lumi") - firstindex = indices.array(b"FirstIndex") - lastindex = indices.array(b"LastIndex") - types = indices.array(b"Type") +if 'Indices;1' in things: + indices = f['Indices'] + runs = indices['Run'].array() + lumis = indices['Lumi'].array() + firstindex = indices['FirstIndex'].array() + lastindex = indices['LastIndex'].array() + types = indices['Type'].array() # If run is not provided, print all available runs in a given file. if args.r == None or args.r < 0: @@ -36,25 +36,24 @@ exit() treenames = [ # order matters! - b"Ints", - b"Floats", - b"Strings", - b"TH1Fs", - b"TH1Ss", - b"TH1Ds", - b"TH2Fs", - b"TH2Ss", - b"TH2Ds", - b"TH3Fs", - b"TProfiles", - b"TProfile2Ds" + "Ints", + "Floats", + "Strings", + "TH1Fs", + "TH1Ss", + "TH1Ds", + "TH2Fs", + "TH2Ss", + "TH2Ds", + "TH3Fs", + "TProfiles", + "TProfile2Ds" ] - trees = [f[name][b"FullName"].array() for name in treenames] + trees = [f[name]["FullName"].array() for name in treenames] for run, lumi, first, last, type in zip(runs, lumis, firstindex, lastindex, types): if run == args.r and lumi == args.l: for i in range(first, int(last + 1)): # In DQMIO both ranges are inclusive - print(trees[type][i].decode()) + print(trees[type][i]) else: print("This does not look like DQMIO data.") - diff --git a/DQMServices/Demo/test/runtests.sh b/DQMServices/Demo/test/runtests.sh index 7d018032a7d38..6c94d32c7b88c 100755 --- a/DQMServices/Demo/test/runtests.sh +++ b/DQMServices/Demo/test/runtests.sh @@ -72,7 +72,7 @@ dqmiodumpmetadata.py merged.root | grep -q '4 runs, 12 lumisections' rootlist () { python3 -c ' import uproot -for k in uproot.open("'"$1"'").allkeys(): print(k.decode())' +for k in uproot.open("'"$1"'").keys(): print(k)' } # we need to exclude MEs filled on run and lumi boundaries, since the split job *does* see a different number of begin/end run/lumi transitions.