Skip to content

Commit

Permalink
add test case for ak.broadcast_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
pfackeldey committed Oct 1, 2024
1 parent f00aac5 commit 36fd4f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/test_2596_named_axis.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,15 @@ def test_named_axis_ak_backend():


def test_named_axis_ak_broadcast_fields():
# what to do with this one?
assert True
x = ak.Array([{"x": {"y": 1, "z": 2, "w": [1]}}])
y = ak.Array([{"x": [{"y": 1}]}])

nx = ak.with_named_axis(x, named_axis=("x", "y"))
ny = ak.with_named_axis(y, named_axis=("a", "b"))

na, nb = ak.broadcast_fields(nx, ny)
assert na.named_axis == {"x": 0, "y": 1}
assert nb.named_axis == {"a": 0, "b": 1}


def test_named_axis_ak_cartesian():
Expand Down

0 comments on commit 36fd4f5

Please sign in to comment.