@@ -46,17 +46,17 @@ def test_histogram1d(a, opt):
4646 h1 , e1 = np .histogram (v , ** opt )
4747 h2 , e2 = bh .numpy .histogram (v , ** opt )
4848
49- np . testing . assert_array_almost_equal ( e1 , e2 )
50- np . testing . assert_array_equal ( h1 , h2 )
49+ assert e1 == approx ( e2 )
50+ assert h1 == approx ( h2 )
5151
5252 opt = copy .deepcopy (opt )
5353 opt ["density" ] = True
5454
5555 h1 , e1 = np .histogram (v , ** opt )
5656 h2 , e2 = bh .numpy .histogram (v , ** opt )
5757
58- np . testing . assert_array_almost_equal ( e1 , e2 )
59- np . testing . assert_array_almost_equal ( h1 , h2 )
58+ assert e1 == approx ( e2 )
59+ assert h1 == approx ( h2 )
6060
6161
6262@pytest .mark .parametrize ("a" , inputs_1d )
@@ -71,11 +71,11 @@ def test_histogram1d_object(a, opt):
7171 bh_h2 = bh .numpy .histogram (v , ** bh_opt )
7272 h2 , e2 = bh_h2 .to_numpy ()
7373
74- np . testing . assert_array_almost_equal ( e1 , e2 )
75- np . testing . assert_array_equal ( h1 , h2 )
74+ assert e1 == approx ( e2 )
75+ assert h1 == approx ( h2 )
7676
7777 # Ensure reducible
78- assert bh_h2 [:5 ].values () == pytest . approx (h1 [:5 ])
78+ assert bh_h2 [:5 ].values () == approx (h1 [:5 ])
7979
8080 opt = copy .deepcopy (opt )
8181 opt ["density" ] = True
@@ -94,16 +94,16 @@ def test_histogram2d():
9494 h1 , e1x , e1y = np .histogram2d (x , y )
9595 h2 , e2x , e2y = bh .numpy .histogram2d (x , y )
9696
97- np . testing . assert_array_almost_equal ( e1x , e2x )
98- np . testing . assert_array_almost_equal ( e1y , e2y )
99- np . testing . assert_array_equal ( h1 , h2 )
97+ assert e1x == approx ( e2x )
98+ assert e1y == approx ( e2y )
99+ assert h1 == approx ( h2 )
100100
101101 h1 , e1x , e1y = np .histogram2d (x , y , density = True )
102102 h2 , e2x , e2y = bh .numpy .histogram2d (x , y , density = True )
103103
104- np . testing . assert_array_almost_equal ( e1x , e2x )
105- np . testing . assert_array_almost_equal ( e1y , e2y )
106- np . testing . assert_array_almost_equal ( h1 , h2 )
104+ assert e1x == approx ( e2x )
105+ assert e1y == approx ( e2y )
106+ assert h1 == approx ( h2 )
107107
108108
109109def test_histogram2d_object ():
@@ -114,9 +114,9 @@ def test_histogram2d_object():
114114 bh_h2 = bh .numpy .histogram2d (x , y , histogram = bh .Histogram )
115115 h2 , e2x , e2y = bh_h2 .to_numpy ()
116116
117- np . testing . assert_array_almost_equal ( e1x , e2x )
118- np . testing . assert_array_almost_equal ( e1y , e2y )
119- np . testing . assert_array_equal ( h1 , h2 )
117+ assert e1x == approx ( e2x )
118+ assert e1y == approx ( e2y )
119+ assert h1 == approx ( h2 )
120120
121121 with pytest .raises (KeyError ):
122122 bh .numpy .histogram2d (x , y , density = True , histogram = bh .Histogram )
@@ -130,18 +130,18 @@ def test_histogramdd():
130130 h1 , (e1x , e1y , e1z ) = np .histogramdd ([x , y , z ])
131131 h2 , (e2x , e2y , e2z ) = bh .numpy .histogramdd ([x , y , z ])
132132
133- np . testing . assert_array_almost_equal ( e1x , e2x )
134- np . testing . assert_array_almost_equal ( e1y , e2y )
135- np . testing . assert_array_almost_equal ( e1z , e2z )
136- np . testing . assert_array_equal ( h1 , h2 )
133+ assert e1x == approx ( e2x )
134+ assert e1y == approx ( e2y )
135+ assert e1z == approx ( e2z )
136+ assert h1 == approx ( h2 )
137137
138138 h1 , (e1x , e1y , e1z ) = np .histogramdd ([x , y , z ], density = True )
139139 h2 , (e2x , e2y , e2z ) = bh .numpy .histogramdd ([x , y , z ], density = True )
140140
141- np . testing . assert_array_almost_equal ( e1x , e2x )
142- np . testing . assert_array_almost_equal ( e1y , e2y )
143- np . testing . assert_array_almost_equal ( e1z , e2z )
144- np . testing . assert_array_almost_equal ( h1 , h2 )
141+ assert e1x == approx ( e2x )
142+ assert e1y == approx ( e2y )
143+ assert e1z == approx ( e2z )
144+ assert h1 == approx ( h2 )
145145
146146
147147def test_histogramdd_object ():
@@ -153,10 +153,10 @@ def test_histogramdd_object():
153153 bh_h2 = bh .numpy .histogramdd ([x , y , z ], histogram = bh .Histogram )
154154 h2 , (e2x , e2y , e2z ) = bh_h2 .to_numpy (dd = True )
155155
156- np . testing . assert_array_almost_equal ( e1x , e2x )
157- np . testing . assert_array_almost_equal ( e1y , e2y )
158- np . testing . assert_array_almost_equal ( e1z , e2z )
159- np . testing . assert_array_equal ( h1 , h2 )
156+ assert e1x == approx ( e2x )
157+ assert e1y == approx ( e2y )
158+ assert e1z == approx ( e2z )
159+ assert h1 == approx ( h2 )
160160
161161 with pytest .raises (KeyError ):
162162 bh .numpy .histogramdd ([x , y , z ], density = True , histogram = bh .Histogram )
0 commit comments