Skip to content

Commit

Permalink
fix: remove old argument from broadcast_and_apply (#2790)
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 authored Nov 1, 2023
1 parent d3793f4 commit 2fbaa2c
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 18 deletions.
1 change: 1 addition & 0 deletions src/awkward/_broadcasting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ def continuation():
def broadcast_and_apply(
inputs,
action,
*,
depth_context: dict[str, Any] | None = None,
lateral_context: dict[str, Any] | None = None,
allow_records: bool = True,
Expand Down
5 changes: 1 addition & 4 deletions src/awkward/operations/ak_concatenate.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,7 @@ def action(inputs, depth, **kwargs):
return None

out = ak._broadcasting.broadcast_and_apply(
content_or_others,
action,
allow_records=True,
right_broadcast=False,
content_or_others, action, allow_records=True, right_broadcast=False
)[0]

return wrap_layout(out, behavior, highlevel)
Expand Down
5 changes: 1 addition & 4 deletions src/awkward/operations/ak_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@ def action(inputs, backend, **kwargs):

behavior = behavior_of(array, mask, behavior=behavior)
out = ak._broadcasting.broadcast_and_apply(
[layoutarray, layoutmask],
action,
numpy_to_regular=True,
right_broadcast=False,
[layoutarray, layoutmask], action, numpy_to_regular=True, right_broadcast=False
)
assert isinstance(out, tuple) and len(out) == 1
return wrap_layout(out[0], behavior, highlevel)
4 changes: 1 addition & 3 deletions src/awkward/operations/ak_where.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ def action(inputs, **kwargs):
return None

out = ak._broadcasting.broadcast_and_apply(
[condition_layout, x_layout, y_layout],
action,
numpy_to_regular=True,
[condition_layout, x_layout, y_layout], action, numpy_to_regular=True
)

return wrap_layout(out[0], behavior, highlevel)
4 changes: 1 addition & 3 deletions src/awkward/operations/ak_with_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,7 @@ def action(inputs, **kwargs):
return None

out = ak._broadcasting.broadcast_and_apply(
[base, what],
action,
right_broadcast=False,
[base, what], action, right_broadcast=False
)

assert isinstance(out, tuple) and len(out) == 1
Expand Down
2 changes: 1 addition & 1 deletion src/awkward/operations/ak_zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def action(inputs, depth, **ignore):
return None

out = ak._broadcasting.broadcast_and_apply(
layouts, action, behavior, right_broadcast=right_broadcast
layouts, action, right_broadcast=right_broadcast
)
assert isinstance(out, tuple) and len(out) == 1
out = out[0]
Expand Down
3 changes: 1 addition & 2 deletions src/awkward/operations/str/akstr_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ def apply_binary(layouts, **kwargs):
)

(out,) = ak._broadcasting.broadcast_and_apply(
(layout, separator_layout),
apply_binary,
(layout, separator_layout), apply_binary
)

return wrap_layout(out, highlevel=highlevel, behavior=behavior)
2 changes: 1 addition & 1 deletion src/awkward/operations/str/akstr_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def action(inputs, **kwargs):
return (_apply_through_arrow(pc.binary_repeat, *inputs),)

(out,) = ak._broadcasting.broadcast_and_apply(
(layout, num_repeats_layout), action, behavior
(layout, num_repeats_layout), action
)

else:
Expand Down

0 comments on commit 2fbaa2c

Please sign in to comment.