Skip to content

Commit c9b9596

Browse files
committed
add a multiarg test
1 parent 7192b54 commit c9b9596

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/test_boost.py

+34
Original file line numberDiff line numberDiff line change
@@ -602,3 +602,37 @@ def test_155_2():
602602
assert np.all(
603603
hist.values() == [0.0, 3.0, 6.0, 9.0, 12.0, 15.0, 18.0, 21.0, 24.0, 27.0]
604604
)
605+
606+
607+
def test_155_3_2d():
608+
import boost_histogram as bh
609+
610+
dak = pytest.importorskip("dask_awkward")
611+
612+
import dask_histogram as dh
613+
614+
arr1 = dak.from_lists([list(range(10))] * 3)
615+
arr2 = dak.from_lists([list(reversed(range(10)))] * 3)
616+
axis1 = bh.axis.Regular(10, 0.0, 10.0)
617+
axis2 = bh.axis.Regular(10, 0.0, 10.0)
618+
hist = dh.factory(
619+
arr1,
620+
arr2,
621+
axes=(axis1, axis2),
622+
weights=arr1,
623+
).compute()
624+
should_be = (
625+
[
626+
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
627+
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0],
628+
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6.0, 0.0, 0.0],
629+
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9.0, 0.0, 0.0, 0.0],
630+
[0.0, 0.0, 0.0, 0.0, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0],
631+
[0.0, 0.0, 0.0, 0.0, 15.0, 0.0, 0.0, 0.0, 0.0, 0.0],
632+
[0.0, 0.0, 0.0, 18.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
633+
[0.0, 0.0, 21.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
634+
[0.0, 24.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
635+
[27.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
636+
],
637+
)
638+
assert np.all(hist.values() == should_be)

0 commit comments

Comments
 (0)