@@ -602,3 +602,37 @@ def test_155_2():
602
602
assert np .all (
603
603
hist .values () == [0.0 , 3.0 , 6.0 , 9.0 , 12.0 , 15.0 , 18.0 , 21.0 , 24.0 , 27.0 ]
604
604
)
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