You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to access the children of an object loaded as a dask_awkward array and then computed I get the error:
File~/mambaforge/envs/python311/lib/python3.11/site-packages/coffea/nanoevents/methods/nanoaod.py:139, inGenParticle.children(self)
133 @dask_property134defchildren(self):
135""" 136 Accessor to direct children of this particle (not grandchildren). Includes particles 137 with the same PDG ID as this particle. 138 """-->139returnself._events().GenPart._apply_global_index(self.childrenIdxG)
File~/mambaforge/envs/python311/lib/python3.11/site-packages/coffea/nanoevents/methods/base.py:270, inNanoCollection._events(self)
268if"@original_array"inself.attrs:
269returnself.attrs["@original_array"]
-->270returnself.attrs["@events_factory"].events()
KeyError: '@events_factory'
The issue here is that the self-reference to the original events is lost when you compute (because you can't recursively compute a dask array!). So this isn't actually a bug but rather a consequence of how dask works.
I would suggest instead using delayed=False and doing your data exploration with completely eager nanoevents on that single file or you can try higgs.children.compute() and then work with that array (which you will not be able to recurse through.
Or if you know what you're looking for you can work with the dask array itself and then only compute what you want.
I see. For context, I was trying to compute earlier than needed as a workaround for #1199, i.e., trying to flatten higgs.children.compute().children instead of higgs.children.children which gives an error.
Describe the bug
If I try to access the children of an object loaded as a dask_awkward array and then computed I get the error:
with coffea 2024.10.0 awkward 2.6.9.
To Reproduce
MRE:
The text was updated successfully, but these errors were encountered: