Gate
Gate copied to clipboard
test5 failure
Describe the bug The test5 (pet) failed for all tests on Github Actions.
Desktop (please complete the following information):
- Github actions
Additional context The error was introduced after the merging of that commit: https://github.com/OpenGATE/Gate/pull/534
See https://github.com/OpenGATE/Gate/runs/6832531413?check_suite_focus=true
The error is :
Traceback (most recent call last):
File "/usr/local/bin/gt_merge_root", line 6, in <module>
exec(compile(open(__file__).read(), __file__, 'exec'))
File "/software/gatetools/bin/gt_merge_root", line 54, in <module>
gt_merge_root_main()
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/software/gatetools/bin/gt_merge_root", line 49, in gt_merge_root_main
gt.merge_root(inputs, output, incrementrunid)
File "/software/gatetools/gatetools/merge_root.py", line 87, in merge_root
out[tree] = uproot.newtree(trees[tree]["rootDictType"])
File "/usr/local/lib/python3.6/site-packages/uproot3/write/TFile.py", line 90, in __setitem__
what = TTree(where, what, self)
File "/usr/local/lib/python3.6/site-packages/uproot3/write/objects/TTree.py", line 86, in __init__
self._branches[name] = TBranch(name, branch, compression, self, file)
File "/usr/local/lib/python3.6/site-packages/uproot3/write/objects/TTree.py", line 253, in __init__
self._branch = TBranchImpl(name, branchobj, compression, file)
File "/usr/local/lib/python3.6/site-packages/uproot3/write/objects/TTree.py", line 819, in __init__
raise NotImplementedError
NotImplementedError
Traceback (most recent call last):
File "runBenchmark.py", line 98, in <module>
runTests_click()
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "runBenchmark.py", line 31, in runTests_click
returnedTest = runTests(test)
File "runBenchmark.py", line 89, in runTests
analyseOutput = runAnalysis.analyse_all_folders(outputFolders)
File "./runAnalysis.py", line 297, in analyse_all_folders
r = plot_all(outputFolders, ax)
File "./runAnalysis.py", line 255, in plot_all
dictTest = analyse_pet(o, ax, 3*i)
File "./runAnalysis.py", line 54, in analyse_pet
singles = f['Singles']
File "/usr/local/lib/python3.6/site-packages/uproot/reading.py", line 2096, in __getitem__
return self.key(where).get()
File "/usr/local/lib/python3.6/site-packages/uproot/reading.py", line 2047, in key
item, cycle="any", keys=self.keys(), file_path=self._file.file_path
uproot.exceptions.KeyInFileError: not found: 'Singles' (with any cycle number)
Available keys: 'pet_data;1'
in file output/pet.root
+ OutputTest='/software/gate/bin/Gate
Found Gate in folder: /software/gate/bin/Gate
WARNING: The output folder already exist: /home/t5_pet/output
Evereything will be overwritten
Run Id is: output
No qsub, run Gate on multiple cores.
2 jobs running
Run folder is: /home/t5_pet/output
!!!! this is /software/gatetools/clustertools/gate_power_merge.sh v0.3k !!!!
Usage: gate_power_merge.sh run.dir [--force]
where --force allows to merge files even if the file is missing in some output directories
found 2 partial output dirs
output dir is results
files pet.root stat.txt
merging pet.root
** testing file type on output/output.local_1/pet.root
** this is a root file
** entering root merger
** merger is gt_merge_root
** creating results/pet.root
ERROR: error while calling gt_merge_root
The test is due to gt_merge_root. The new key "volumeID" in Singles tree leads to the error.
The types in Singles tree is:
{b'runID': <class 'numpy.int32'>,
b'eventID': <class 'numpy.int32'>,
b'sourceID': <class 'numpy.int32'>,
b'sourcePosX': <class 'numpy.float32'>,
b'sourcePosY': <class 'numpy.float32'>,
b'sourcePosZ': <class 'numpy.float32'>,
b'time': <class 'numpy.float64'>,
b'energy': <class 'numpy.float32'>,
b'globalPosX': <class 'numpy.float32'>,
b'globalPosY': <class 'numpy.float32'>,
b'globalPosZ': <class 'numpy.float32'>,
b'gantryID': <class 'numpy.int32'>,
b'rsectorID': <class 'numpy.int32'>,
b'moduleID': <class 'numpy.int32'>,
b'submoduleID': <class 'numpy.int32'>,
b'crystalID': <class 'numpy.int32'>,
b'layerID': <class 'numpy.int32'>,
b'comptonPhantom': <class 'numpy.int32'>,
b'comptonCrystal': <class 'numpy.int32'>,
b'RayleighPhantom': <class 'numpy.int32'>,
b'RayleighCrystal': <class 'numpy.int32'>,
b'axialPos': <class 'numpy.float32'>,
b'rotationAngle': <class 'numpy.float32'>,
b'comptVolName': <class 'numpy.int64'>,
b'RayleighVolName': <class 'numpy.int64'>,
b'volumeID': <class 'numpy.ndarray'>}
So it seems that volumeID type is ndArray instead of number.
Is it normal to store a vector? In the gatetools, maybe we can try to detect the type and merge the vector differently if needed.
corrected with updated gatetools