scikit-hep / uproot5

ROOT I/O in pure Python and NumPy.
https://uproot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
239 stars 76 forks source link

Error reading baskets #1243

Closed kskovpen closed 4 months ago

kskovpen commented 5 months ago

Hello,

While reading the file previously created with uproot, I noticed the crash when one of the branches does not have entries. The same file can be opened with ROOT without issues.

wget https://homepage.iihe.ac.be/~kskovpen/h.root

>>> import uproot
>>> f = uproot.open('h.root')
>>> tr = f['ntuple']
>>> for arrays in tr.iterate(): print('test')

This crashes into ValueError: basket 0 in tree/branch /ntuple;1:muon_pt has the wrong number of entries (expected 18, obtained 0) when interpreted as AsDtype('>f4').