@@ -11,18 +11,18 @@ def test_make_regular_1D(opt, extent):
1111 )
1212
1313 assert hist .rank == 1
14- assert hist .axis ( 0 ) .size == 3
15- assert hist .axis ( 0 ) .extent == 3 + extent
16- assert hist .axis ( 0 ) .bin (1 ) == (3 , 4 )
14+ assert hist .axes [ 0 ] .size == 3
15+ assert hist .axes [ 0 ] .extent == 3 + extent
16+ assert hist .axes [ 0 ] .bin (1 ) == (3 , 4 )
1717
1818
1919def test_shortcuts ():
2020 hist = bh .histogram ((1 , 2 , 3 ), (10 , 0 , 1 ))
2121 assert hist .rank == 2
2222 for i in range (2 ):
23- assert isinstance (hist .axis ( i ) , bh .axis .regular )
24- assert isinstance (hist .axis ( i ) , bh .core .axis ._regular_uoflow )
25- assert not isinstance (hist .axis ( i ) , bh .axis .variable )
23+ assert isinstance (hist .axes [ i ] , bh .axis .regular )
24+ assert isinstance (hist .axes [ i ] , bh .core .axis ._regular_uoflow )
25+ assert not isinstance (hist .axes [ i ] , bh .axis .variable )
2626
2727
2828def test_shortcuts_with_metadata ():
@@ -42,13 +42,13 @@ def test_make_regular_2D(opt, extent):
4242 )
4343
4444 assert hist .rank == 2
45- assert hist .axis ( 0 ) .size == 3
46- assert hist .axis ( 0 ) .extent == 3 + extent
47- assert hist .axis ( 0 ) .bin (1 ) == approx ((3 , 4 ))
45+ assert hist .axes [ 0 ] .size == 3
46+ assert hist .axes [ 0 ] .extent == 3 + extent
47+ assert hist .axes [ 0 ] .bin (1 ) == approx ((3 , 4 ))
4848
49- assert hist .axis ( 1 ) .size == 5
50- assert hist .axis ( 1 ) .extent == 5 + extent
51- assert hist .axis ( 1 ) .bin (1 ) == approx ((2 , 3 ))
49+ assert hist .axes [ 1 ] .size == 5
50+ assert hist .axes [ 1 ] .extent == 5 + extent
51+ assert hist .axes [ 1 ] .bin (1 ) == approx ((2 , 3 ))
5252
5353
5454@pytest .mark .parametrize (
@@ -69,24 +69,24 @@ def test_make_any_hist(storage):
6969 )
7070
7171 assert hist .rank == 3
72- assert hist .axis ( 0 ) .size == 3
73- assert hist .axis ( 0 ) .extent == 5
74- assert hist .axis ( 0 ) .bin (1 ) == approx ((2 , 3 ))
75- assert hist .axis ( 1 ) .size == 2
76- assert hist .axis ( 1 ) .extent == 2
77- assert hist .axis ( 1 ) .bin (1 ) == approx ((3 , 4 ))
78- assert hist .axis ( 2 ) .size == 4
79- assert hist .axis ( 2 ) .extent == 5
80- assert hist .axis ( 2 ) .bin (1 ) == approx ((2 , 3 ))
72+ assert hist .axes [ 0 ] .size == 3
73+ assert hist .axes [ 0 ] .extent == 5
74+ assert hist .axes [ 0 ] .bin (1 ) == approx ((2 , 3 ))
75+ assert hist .axes [ 1 ] .size == 2
76+ assert hist .axes [ 1 ] .extent == 2
77+ assert hist .axes [ 1 ] .bin (1 ) == approx ((3 , 4 ))
78+ assert hist .axes [ 2 ] .size == 4
79+ assert hist .axes [ 2 ] .extent == 5
80+ assert hist .axes [ 2 ] .bin (1 ) == approx ((2 , 3 ))
8181
8282
8383def test_make_any_hist_storage ():
8484
8585 assert float != type (
86- bh .histogram (bh .axis .regular (5 , 1 , 2 ), storage = bh .storage .int ()). at ( 0 )
86+ bh .histogram (bh .axis .regular (5 , 1 , 2 ), storage = bh .storage .int ())[ 0 ]
8787 )
8888 assert float == type (
89- bh .histogram (bh .axis .regular (5 , 1 , 2 ), storage = bh .storage .double ()). at ( 0 )
89+ bh .histogram (bh .axis .regular (5 , 1 , 2 ), storage = bh .storage .double ())[ 0 ]
9090 )
9191
9292
@@ -96,14 +96,14 @@ def test_issue_axis_bin_swan():
9696 bh .axis .circular (10 , 0 , 1 , metadata = "y" ),
9797 )
9898
99- b = hist .axis ( 1 ) .bin (1 )
99+ b = hist .axes [ 1 ] .bin (1 )
100100 assert repr (b ) == "(0.1, 0.2)"
101101 assert b [0 ] == approx (0.1 )
102102 assert b [1 ] == approx (0.2 )
103103
104- assert hist .axis ( 0 ) .bin (0 )[0 ] == 0
105- assert hist .axis ( 0 ) .bin (1 )[0 ] == approx (0.1 )
106- assert hist .axis ( 0 ) .bin (2 )[0 ] == approx (0.4 )
104+ assert hist .axes [ 0 ] .bin (0 )[0 ] == 0
105+ assert hist .axes [ 0 ] .bin (1 )[0 ] == approx (0.1 )
106+ assert hist .axes [ 0 ] .bin (2 )[0 ] == approx (0.4 )
107107
108108
109109options = (
0 commit comments