-
Notifications
You must be signed in to change notification settings - Fork 62
Description
The issue is the following, when indexing a frame iterator and using it in the same line:
import podio
podio_reader = podio.root_io.Reader("example_frame.root")
frames = podio_reader.get("events")
print(len(frames[0].get('mcparticles'))) # prints a random number like 811654108391827the number printed is consistent with reading some random memory (64 bits). Or if the number is too big, the error will be:
OverflowError: cannot fit 'int' into an index-sized integerThe workaround is easy, just save the intermediate frame (explaining why this has not been before since typically one will loop over the frames):
ev = frames[0]
print(len(ev.get('mcparticles'))) # prints 10, all is good hereFrom this it just seems that frames[0] is not constructed properly in python. Any other operation that I have tried will also fail.
It seems not to be an issue with podio (leaving only cppyy), at least not with the python code, because if we get down to the functions that are actually being called and do:
print(podio.Frame(cppyy.gbl.std.move(podio_reader._reader.readEntry("events", 0))).get('mcparticles').size())this will also print a random number. I'll try to prepare an example to report this to cppyy if that is the case (looks like).