dask-contrib / dask-histogram

Histograms with task scheduling.
https://dask-histogram.readthedocs.io
BSD 3-Clause "New" or "Revised" License
23 stars 4 forks source link

bug: dask histograms are not recognized as `compute`-able #36

Closed lgray closed 1 year ago

lgray commented 1 year ago

if I have a dict of stuff to compute like:

out = {'mass': Histogram(
   StrCategory(['ZJets', 'Data'], growth=True),
   Regular(30000, 0.25, 300),
   storage=Double()) # (has staged fills),
 'pt': Histogram(
   StrCategory(['ZJets', 'Data'], growth=True),
   Regular(30000, 0.24, 300),
   storage=Double()) # (has staged fills),
 'cutflow': {'ZJets_pt': dask.awkward<sum-agg, type=Scalar, dtype=Unknown>,
  'ZJets_mass': dask.awkward<sum-agg, type=Scalar, dtype=Unknown>,
  'Data_pt': dask.awkward<sum-agg, type=Scalar, dtype=Unknown>,
  'Data_mass': dask.awkward<sum-agg, type=Scalar, dtype=Unknown>}}

where mass and pt are dask_histograms. When I do dask.compute(out) the dask_awkward sums are computed but not the histograms!

and in fact:

dask.compute(out["mass"])

just returns again the dask_histogram as though it's not recognized as a dask collection at all.