-
Notifications
You must be signed in to change notification settings - Fork 87
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
fix: add highlevel
, behavior
arguments to composite reducers
#2754
fix: add highlevel
, behavior
arguments to composite reducers
#2754
Conversation
Codecov Report
Additional details and impacted files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was an oversight. The functions you found are all of the "pseudoreducers." They were added as a pack, all at once.
This looks done, it's a straightforward fix, and it has been hours since you touched it, so I'm going to merge it. |
def maybe_highlevel_to_lowlevel(obj): | ||
""" | ||
Args: | ||
obj: an object | ||
|
||
Calls #ak.to_layout and returns the result iff. the object is a high-level | ||
Awkward object, otherwise the object is returned as-is. | ||
|
||
This function should be removed once scalars are properly handled by `to_layout`. | ||
""" | ||
import awkward.highlevel | ||
|
||
if isinstance( | ||
obj, | ||
( | ||
awkward.highlevel.Array, | ||
awkward.highlevel.Record, | ||
awkward.highlevel.ArrayBuilder, | ||
), | ||
): | ||
return awkward.to_layout(obj) | ||
else: | ||
return obj | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will get rid of this function once our policies for ak.to_layout
of scalars are more well defined.
A number of high-level operations in Awkward Array did not accept the
highlevel
orbehavior
arguments. I don't think we ever explicitly decided upon this, so I assume that it is an oversight in need of correction!