-
Notifications
You must be signed in to change notification settings - Fork 89
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
Intersecting parameters introduced "unhashable type" bug. #1707
Labels
bug
The problem described is something that must be fixed
Comments
An oversight on my part.
Yes, in the case of |
agoose77
added a commit
that referenced
this issue
Sep 20, 2022
agoose77
added a commit
that referenced
this issue
Sep 20, 2022
agoose77
added a commit
that referenced
this issue
Sep 21, 2022
agoose77
added a commit
that referenced
this issue
Sep 21, 2022
jpivarski
pushed a commit
that referenced
this issue
Sep 21, 2022
* fix: handle non-hashable parameters, fixes #1707 * test: validate fix for #1707 * refactor: move parameter util function to `form` * refactor: result of `reduce` is already dict * refactor: pre-determine set of keys to compare * refactor: make parameter broadcasting public * fix: (partial) broadcast parameters within ufunc mechanism * fix: (tentative) don't attempt to convert `RegularArray`s into `NumpyArray`s during ufunc broadasting This ensures that parameters remain on the correct layouts
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of Awkward Array
1.10.0
Description and code to reproduce
PR #1679 added parameter-carrying to broadcasting, but if the parameter values are dicts, rather something hashable, like strings, the implementation fails.
versus
It fails in the
functools.reduce
ofawkward/src/awkward/_v2/_broadcasting.py
Lines 262 to 276 in ca1b9d7
in the hashable case, the
parameters_to_intersect
isand in the non-hashable case, it's
The
operator.and_
is a bitwise&
operator—I doubt that's what you want there. I think this can be done more simply in a for loop.Also, possibly related, we're losing parameters in simple arrays:
In this case, it reaches the
break
and therefore skips thereduce
. (Why would_parameters_is_empty
be true for this array that clearly has parameters? I think the first step in broadcasting creates a RegularArray around this NumpyArray—it doesn't collapse the RegularArray + NumpyArray into a multidimensional NumpyArray, and lose the parameter, does it?)Discovered by @philippemiron.
The text was updated successfully, but these errors were encountered: