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

Catch shape issues for histogram filling before compute time #167

Open
alexander-held opened this issue Feb 13, 2025 · 0 comments
Open

Catch shape issues for histogram filling before compute time #167

alexander-held opened this issue Feb 13, 2025 · 0 comments

Comments

@alexander-held
Copy link

The following example fails at dask.compute time due to the array being used to fill the histogram not being flattened:

import uproot
import hist.dask


evts = uproot.dask({"https://github.com/scikit-hep/coffea/raw/refs/heads/master/tests/samples/nano_dy.root": "Events"})
res = hist.dask.Hist.new.Regular(10, 0, 10).Double().fill(evts["Jet_pt"])
res.compute()

After conversation with @lgray I believe this could (ideally should?) already be caught earlier to avoid a runtime error. The ultimate exception that is raised currently is:

ValueError: cannot convert to RegularArray because subarray lengths are not regular (in compiled code: https://github.com/scikit-hep/awkward/blob/awkward-cpp-44/awkward-cpp/src/cpu-kernels/awkward_ListOffsetArray_toRegularArray.cpp#L22)

environment:

Package            Version
------------------ -----------
awkward            2.7.4
awkward_cpp        44
boost-histogram    1.5.1
dask               2025.1.0
dask-awkward       2025.2.0
dask-histogram     2025.2.0
hist               2.8.0
uproot             5.5.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant