Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.metric_table() and .nearest() don't work in certain cases for delayed nanoevents when return_combinations and return_metric are set to True respectively #924

Closed
ikrommyd opened this issue Nov 10, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@ikrommyd
Copy link
Contributor

Describe the bug
This issue is just for tracking since @lgray said it's almost certainly the fact that "the behavior catching for dask awkward only assumes one output."
The methods .metric_table() and .nearest() don't work in delayed nanoevents when return_combinations and return_metric are set to True respectively and fail with TypeError: meta must be an instance of an Awkward Array, not <class 'tuple'>.

To Reproduce

from coffea.nanoevents import NanoEventsFactory

eagerevents = NanoEventsFactory.from_root(
    {
        "https://github.com/CoffeaTeam/coffea/raw/master/tests/samples/nano_dy.root": "Events"
    },
    delayed=False,
).events()

daskevents = NanoEventsFactory.from_root(
    {
        "https://github.com/CoffeaTeam/coffea/raw/master/tests/samples/nano_dy.root": "Events"
    },
    delayed=True,
).events()

print(eagerevents.Electron.metric_table(eagerevents.TrigObj, return_combinations=True))
print(eagerevents.Electron.nearest(eagerevents.TrigObj, return_metric=True))

print(daskevents.Electron.metric_table(daskevents.TrigObj, return_combinations=True))
print(daskevents.Electron.nearest(daskevents.TrigObj, return_metric=True))

The first two print statements work as expected.
The other two fail with TypeError: meta must be an instance of an Awkward Array, not <class 'tuple'>.

Expected behavior
They should all work.

@ikrommyd ikrommyd added the bug Something isn't working label Nov 10, 2023
@ikrommyd
Copy link
Contributor Author

@lgray please dm me on slack when you get the chance like you said in the awkward-dask meeting

@ikrommyd
Copy link
Contributor Author

ikrommyd commented Dec 2, 2023

This is partially fixed by #925 but only works with dask_awkward column optimization off. Waiting for upstream dask_awkward fixes to completely close this one.

@lgray lgray changed the title .metric_table() and .nearest() don't work in delayed nanoevents when return_combinations and return_metric are set to True respectively .metric_table() and .nearest() don't work in certain cases for delayed nanoevents when return_combinations and return_metric are set to True respectively Dec 14, 2023
@lgray
Copy link
Collaborator

lgray commented Jan 20, 2024

Fixed by dask-contrib/dask-awkward#430

@lgray lgray closed this as completed Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants