Skip to content
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

Swap 'merged dtype same as NumPy' test of v1 for test of v2. #1515

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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