Skip to content

Commit

Permalink
Swap 'merged dtype same as NumPy' test of v1 for test of v2. (#1515)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski authored Jun 23, 2022
1 parent 2b6252d commit 00d9b7a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 31 deletions.
10 changes: 5 additions & 5 deletions tests/test_0449-merge-many-arrays-in-one-pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_numpyarray():
)

assert ak.to_list(ak_combined) == combined.tolist()
assert ak.to_numpy(ak_combined).dtype == combined.dtype
# assert ak.to_numpy(ak_combined).dtype == combined.dtype

ak_combined = ak.layout.NumpyArray(one).mergemany(
[
Expand All @@ -60,10 +60,10 @@ def test_numpyarray():
)

assert ak.to_list(ak_combined) == combined.tolist()
assert (
ak.to_numpy(ak_combined).dtype
== np.concatenate([one, two, four]).dtype
)
# assert (
# ak.to_numpy(ak_combined).dtype
# == np.concatenate([one, two, four]).dtype
# )


def test_lists():
Expand Down
66 changes: 40 additions & 26 deletions tests/v2/test_0449-merge-many-arrays-in-one-pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,26 @@ def test_numpyarray():
assert to_list(ak_combined) == combined.tolist()
assert ak_combined.dtype == combined.dtype

# assert ak._v2.contents.NumpyArray(one).typetracer.mergemany(
# [
# ak._v2.contents.NumpyArray(two),
# ak._v2.contents.NumpyArray(three),
# ak._v2.contents.NumpyArray(four),
# ]
# ).form == ak._v2.contents.NumpyArray(one).mergemany(
# [
# ak._v2.contents.NumpyArray(two),
# ak._v2.contents.NumpyArray(three),
# ak._v2.contents.NumpyArray(four),
# ]
# ).form
assert (
ak._v2.contents.NumpyArray(one)
.typetracer.mergemany(
[
ak._v2.contents.NumpyArray(two),
ak._v2.contents.NumpyArray(three),
ak._v2.contents.NumpyArray(four),
]
)
.form
== ak._v2.contents.NumpyArray(one)
.mergemany(
[
ak._v2.contents.NumpyArray(two),
ak._v2.contents.NumpyArray(three),
ak._v2.contents.NumpyArray(four),
]
)
.form
)

ak_combined = ak._v2.contents.NumpyArray(one).mergemany(
[
Expand All @@ -78,19 +85,26 @@ def test_numpyarray():
assert to_list(ak_combined) == combined.tolist()
assert ak_combined.dtype == np.concatenate([one, two, four]).dtype

# assert ak._v2.contents.NumpyArray(one).typetracer.mergemany(
# [
# ak._v2.contents.NumpyArray(two),
# ak._v2.contents.EmptyArray(),
# ak._v2.contents.NumpyArray(four),
# ]
# ).form == ak._v2.contents.NumpyArray(one).mergemany(
# [
# ak._v2.contents.NumpyArray(two),
# ak._v2.contents.EmptyArray(),
# ak._v2.contents.NumpyArray(four),
# ]
# ).form
assert (
ak._v2.contents.NumpyArray(one)
.typetracer.mergemany(
[
ak._v2.contents.NumpyArray(two),
ak._v2.contents.EmptyArray(),
ak._v2.contents.NumpyArray(four),
]
)
.form
== ak._v2.contents.NumpyArray(one)
.mergemany(
[
ak._v2.contents.NumpyArray(two),
ak._v2.contents.EmptyArray(),
ak._v2.contents.NumpyArray(four),
]
)
.form
)


def test_lists():
Expand Down

0 comments on commit 00d9b7a

Please sign in to comment.