11
11
import hist
12
12
from hist import Hist , axis , storage
13
13
14
- BHV = tuple (int (x ) for x in bh .__version__ .split ("." )[:2 ])
15
-
16
14
# TODO: specify what error is raised
17
15
18
16
@@ -205,21 +203,17 @@ def test_general_fill_integer():
205
203
206
204
def test_general_fill_int_cat ():
207
205
h = Hist (
208
- axis .IntCategory (range (10 ), name = "x" , flow = BHV < ( 1 , 4 ) ),
209
- axis .IntCategory (range (10 ), name = "y" , overflow = BHV < ( 1 , 4 ) ),
206
+ axis .IntCategory (range (10 ), name = "x" , flow = False ),
207
+ axis .IntCategory (range (10 ), name = "y" , overflow = False ),
210
208
axis .IntCategory (range (2 ), name = "z" ),
211
209
).fill (
212
210
x = [3 , 3 , 3 , 4 , 5 , 5 , 5 ],
213
211
y = [3 , 3 , 4 , 4 , 4 , 4 , 4 ],
214
212
z = [0 , 0 , 1 , 1 , 1 , 1 , 1 ],
215
213
)
216
214
217
- if BHV < (1 , 4 ):
218
- assert h .axes [0 ].traits .overflow
219
- assert h .axes [1 ].traits .overflow
220
- else :
221
- assert not h .axes [0 ].traits .overflow
222
- assert not h .axes [1 ].traits .overflow
215
+ assert not h .axes [0 ].traits .overflow
216
+ assert not h .axes [1 ].traits .overflow
223
217
assert h .axes [2 ].traits .overflow
224
218
225
219
z_one_only = h [{2 : bh .loc (1 )}]
@@ -235,21 +229,17 @@ def test_general_fill_int_cat():
235
229
236
230
def test_general_fill_str_cat ():
237
231
h = Hist (
238
- axis .StrCategory ("FT" , name = "x" , flow = BHV < ( 1 , 4 ) ),
239
- axis .StrCategory (list ("FT" ), name = "y" , overflow = BHV < ( 1 , 4 ) ),
232
+ axis .StrCategory ("FT" , name = "x" , flow = False ),
233
+ axis .StrCategory (list ("FT" ), name = "y" , overflow = False ),
240
234
axis .StrCategory (["F" , "T" ], name = "z" ),
241
235
).fill (
242
236
["T" , "T" , "T" , "T" , "T" , "F" , "T" ],
243
237
["F" , "T" , "T" , "F" , "F" , "T" , "F" ],
244
238
["F" , "F" , "T" , "T" , "T" , "T" , "T" ],
245
239
)
246
240
247
- if BHV < (1 , 4 ):
248
- assert h .axes [0 ].traits .overflow
249
- assert h .axes [1 ].traits .overflow
250
- else :
251
- assert not h .axes [0 ].traits .overflow
252
- assert not h .axes [1 ].traits .overflow
241
+ assert not h .axes [0 ].traits .overflow
242
+ assert not h .axes [1 ].traits .overflow
253
243
assert h .axes [2 ].traits .overflow
254
244
255
245
z_one_only = h [{2 : bh .loc ("T" )}]
@@ -307,7 +297,7 @@ def test_general_access():
307
297
h = Hist (
308
298
axis .Regular (50 , - 5 , 5 , name = "Norm" , label = "normal distribution" ),
309
299
axis .Regular (50 , - 5 , 5 , name = "Unif" , label = "uniform distribution" ),
310
- axis .StrCategory (["hi" , "hello" ], name = "Greet" , flow = BHV < ( 1 , 4 ) ),
300
+ axis .StrCategory (["hi" , "hello" ], name = "Greet" , flow = False ),
311
301
axis .Boolean (name = "Yes" ),
312
302
axis .Integer (0 , 1000 , name = "Int" ),
313
303
).fill (
0 commit comments