@@ -31,9 +31,7 @@ def test_correctness_uniform(self):
3131 data = np .random .uniform (0 , 15 , 10000 ).astype (np .float64 )
3232
3333 np_hist , np_edges = np .histogram (data , bins = 75 , range = (0.0 , 15.0 ))
34- opt_hist , opt_edges = histogram (
35- data , bins = 75 , range_vals = (0.0 , 15.0 )
36- )
34+ opt_hist , opt_edges = histogram (data , bins = 75 , range_vals = (0.0 , 15.0 ))
3735
3836 assert_allclose (np_hist , opt_hist , rtol = 1e-14 , atol = 1 )
3937 assert_allclose (np_edges , opt_edges , rtol = 1e-14 )
@@ -44,9 +42,7 @@ def test_correctness_normal(self):
4442 data = np .random .normal (7.5 , 2 , 10000 ).clip (0 , 15 ).astype (np .float64 )
4543
4644 np_hist , np_edges = np .histogram (data , bins = 75 , range = (0.0 , 15.0 ))
47- opt_hist , opt_edges = histogram (
48- data , bins = 75 , range_vals = (0.0 , 15.0 )
49- )
45+ opt_hist , opt_edges = histogram (data , bins = 75 , range_vals = (0.0 , 15.0 ))
5046
5147 assert_allclose (np_hist , opt_hist , rtol = 1e-14 , atol = 1 )
5248 assert_allclose (np_edges , opt_edges , rtol = 1e-14 )
@@ -56,9 +52,7 @@ def test_edge_cases_zeros(self):
5652 data = np .zeros (1000 , dtype = np .float64 )
5753
5854 np_hist , np_edges = np .histogram (data , bins = 75 , range = (0.0 , 15.0 ))
59- opt_hist , opt_edges = histogram (
60- data , bins = 75 , range_vals = (0.0 , 15.0 )
61- )
55+ opt_hist , opt_edges = histogram (data , bins = 75 , range_vals = (0.0 , 15.0 ))
6256
6357 assert_allclose (np_hist , opt_hist , rtol = 1e-14 , atol = 1 )
6458 assert_allclose (np_edges , opt_edges , rtol = 1e-14 )
@@ -68,9 +62,7 @@ def test_edge_cases_max_values(self):
6862 data = np .ones (1000 , dtype = np .float64 ) * 14.999
6963
7064 np_hist , np_edges = np .histogram (data , bins = 75 , range = (0.0 , 15.0 ))
71- opt_hist , opt_edges = histogram (
72- data , bins = 75 , range_vals = (0.0 , 15.0 )
73- )
65+ opt_hist , opt_edges = histogram (data , bins = 75 , range_vals = (0.0 , 15.0 ))
7466
7567 assert_allclose (np_hist , opt_hist , rtol = 1e-14 , atol = 1 )
7668 assert_allclose (np_edges , opt_edges , rtol = 1e-14 )
@@ -80,9 +72,7 @@ def test_boundary_values(self):
8072 data = np .array ([0.0 , 14.999 , 15.0 , 7.5 ] * 250 , dtype = np .float64 )
8173
8274 np_hist , np_edges = np .histogram (data , bins = 75 , range = (0.0 , 15.0 ))
83- opt_hist , opt_edges = histogram (
84- data , bins = 75 , range_vals = (0.0 , 15.0 )
85- )
75+ opt_hist , opt_edges = histogram (data , bins = 75 , range_vals = (0.0 , 15.0 ))
8676
8777 # Allow for small differences at boundaries due to floating point precision
8878 assert_allclose (np_hist , opt_hist , rtol = 1e-14 , atol = 1 )
@@ -93,9 +83,7 @@ def test_bin_edges_values(self):
9383 data = np .linspace (0 , 15 , 1001 , dtype = np .float64 )
9484
9585 np_hist , np_edges = np .histogram (data , bins = 75 , range = (0.0 , 15.0 ))
96- opt_hist , opt_edges = histogram (
97- data , bins = 75 , range_vals = (0.0 , 15.0 )
98- )
86+ opt_hist , opt_edges = histogram (data , bins = 75 , range_vals = (0.0 , 15.0 ))
9987
10088 # Allow for small differences at boundaries due to floating point precision
10189 assert_allclose (np_hist , opt_hist , rtol = 1e-14 , atol = 1 )
@@ -122,12 +110,8 @@ def test_different_bin_counts(self):
122110 data = np .random .random (10000 ).astype (np .float64 ) * 15.0
123111
124112 for bins in [10 , 50 , 100 , 200 ]:
125- np_hist , np_edges = np .histogram (
126- data , bins = bins , range = (0.0 , 15.0 )
127- )
128- opt_hist , opt_edges = histogram (
129- data , bins = bins , range_vals = (0.0 , 15.0 )
130- )
113+ np_hist , np_edges = np .histogram (data , bins = bins , range = (0.0 , 15.0 ))
114+ opt_hist , opt_edges = histogram (data , bins = bins , range_vals = (0.0 , 15.0 ))
131115
132116 assert_allclose (
133117 np_hist ,
@@ -150,9 +134,7 @@ def test_different_ranges(self):
150134
151135 for range_val in [(0.0 , 10.0 ), (0.0 , 20.0 ), (5.0 , 15.0 )]:
152136 np_hist , np_edges = np .histogram (data , bins = 75 , range = range_val )
153- opt_hist , opt_edges = histogram (
154- data , bins = 75 , range_vals = range_val
155- )
137+ opt_hist , opt_edges = histogram (data , bins = 75 , range_vals = range_val )
156138
157139 assert_allclose (
158140 np_hist ,
@@ -177,9 +159,7 @@ def test_non_contiguous_array(self):
177159
178160 assert not data_non_contig .flags ["C_CONTIGUOUS" ]
179161
180- np_hist , np_edges = np .histogram (
181- data_non_contig , bins = 75 , range = (0.0 , 15.0 )
182- )
162+ np_hist , np_edges = np .histogram (data_non_contig , bins = 75 , range = (0.0 , 15.0 ))
183163 opt_hist , opt_edges = histogram (
184164 data_non_contig , bins = 75 , range_vals = (0.0 , 15.0 )
185165 )
@@ -194,9 +174,7 @@ def test_scaling(self, size):
194174 data = np .random .random (size ).astype (np .float64 ) * 15.0
195175
196176 np_hist , np_edges = np .histogram (data , bins = 75 , range = (0.0 , 15.0 ))
197- opt_hist , opt_edges = histogram (
198- data , bins = 75 , range_vals = (0.0 , 15.0 )
199- )
177+ opt_hist , opt_edges = histogram (data , bins = 75 , range_vals = (0.0 , 15.0 ))
200178
201179 assert_allclose (
202180 np_hist ,
0 commit comments