-
Notifications
You must be signed in to change notification settings - Fork 19
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
TypeError: meta must be an instance of an Awkward Array, not <class 'module'> triggered by fill_flattened for a dask-histogram and dask-awkward arrays #531
Comments
This error derives from the fact that we don't implement support for the fill-flattened method in dask-awkward. A rough implementation looks like: import awkward as ak
import dask_awkward as dak
class _DaskAwkwardHistModule:
def unpack(array):
if not ak.fields(array):
return None
return dict(zip(ak.fields(array), ak.unzip(array)))
def broadcast_and_flatten(args):
new_args = []
for arg in args:
if isinstance(arg, dak.Array):
new_args.append(arg)
elif isinstance(arg, dask.Array):
new_args.append(dak.from_dask_array(arg))
else:
new_args.append(dak.from_awkward(ak.Array(arg, backend="numpy")))
assert not any([x.fields for x in new_args])
return tuple(
ak.flatten(x, axis=None) for x in ak.broadcast_arrays(*new_args)
)
dak.Array._histogram_module_ = _DaskAwkwardHistModule I'm not sure how smart that will be with non-equally-partitioned collections. |
@agoose77 , were you thinking to submit that? We could put a restriction on partitions, and reasonable messaging if that's not the case. |
NJManganelli
pushed a commit
to NJManganelli/coffea
that referenced
this issue
Feb 6, 2025
4 tasks
NJManganelli
pushed a commit
to NJManganelli/coffea
that referenced
this issue
Feb 17, 2025
…edSelection class Adjust result object to not break unpacking of cutflow result, restoring one test; need dask-contrib/dask-awkward#531 Remove unnecessary return Cutflow Add boolean_masks_to_categorical_integers for optimization of histogram fill in cutflow WIP add the optimized version of filling cutflows, with a testable v2 variable temprorarily, and new categorical option for additional axis (needs documentation and example) Rename slice to slc WIP weighted cutflow with commonmask, categorical axes, plot_vars still needs much work and cleanup Untested plot_vars function with commonmask and categorical support, using broadcast_arrays func Fixes for original tests to pass WIP - fixes from tests, expanded print header revert change to masks in compute for npz Fix commonmask handling of initial weighted event counts Some logic fixes for weights in npz file Fix for v2 eager mode Handle delayed cutflow to_npz pathway, Weights does not have a compute method black src/coffea/analysis_tools.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying a hist.dask.Hist object's
fill_flattened
method with dask-awkward inputs triggers the error seen below. A concrete Hist with the computed awkward arrays as input succeeds. (Version is potentially wrong, I've installed most of scikit-hep packages as development versions, but all from github approximately 3 weeksago)The text was updated successfully, but these errors were encountered: