@@ -87,8 +87,8 @@ def test_regular(self, underflow: bool, overflow: bool):
8787 assert coord .attrs ["bin_type" ] == "Regular"
8888 assert coord .size == ax .extent
8989 assert coord .attrs ["right_edge" ] == 1.0
90- assert coord .attrs ["underflow" ] is underflow
91- assert coord .attrs ["overflow" ] is overflow
90+ assert coord .attrs ["underflow" ] is int ( underflow )
91+ assert coord .attrs ["overflow" ] is int ( overflow )
9292
9393 slc = slice (1 if underflow else 0 , - 1 if overflow else None )
9494 assert_allclose (coord [slc ], ax .edges [:- 1 ])
@@ -110,8 +110,8 @@ def test_regular_int(self, underflow: bool, overflow: bool):
110110 assert coord .attrs ["bin_type" ] == "Regular"
111111 assert coord .size == ax .extent
112112 assert coord .attrs ["right_edge" ] == 10.0
113- assert coord .attrs ["underflow" ] is underflow
114- assert coord .attrs ["overflow" ] is overflow
113+ assert coord .attrs ["underflow" ] is int ( underflow )
114+ assert coord .attrs ["overflow" ] is int ( overflow )
115115
116116 slc = slice (1 if underflow else 0 , - 1 if overflow else None )
117117 assert_allclose (coord [slc ], ax .edges [:- 1 ])
@@ -133,8 +133,8 @@ def test_int(self, underflow: bool, overflow: bool):
133133 assert coord .attrs ["bin_type" ] == "Integer"
134134 assert coord .size == ax .extent
135135 assert "right_edge" not in coord .attrs
136- assert coord .attrs ["underflow" ] is underflow
137- assert coord .attrs ["overflow" ] is overflow
136+ assert coord .attrs ["underflow" ] is int ( underflow )
137+ assert coord .attrs ["overflow" ] is int ( overflow )
138138
139139 slc = slice (1 if underflow else 0 , - 1 if overflow else None )
140140 assert_allclose (coord [slc ], ax .edges [:- 1 ])
@@ -153,8 +153,8 @@ def test_intcat(self, overflow: bool):
153153 assert coord .size == 5 if overflow else 4
154154 assert np .isdtype (coord .dtype , kind = "signed integer" )
155155 assert coord .attrs ["bin_type" ] == "IntCategory"
156- assert coord .attrs ["underflow" ] is False
157- assert coord .attrs ["overflow" ] is overflow
156+ assert coord .attrs ["underflow" ] == 0
157+ assert coord .attrs ["overflow" ] is int ( overflow )
158158 if overflow :
159159 assert_allclose (coord , [2 , 5 , 8 , 7 , np .iinfo (coord .dtype ).max ])
160160 else :
@@ -172,8 +172,8 @@ def test_int_bool(self, underflow: bool, overflow: bool):
172172 assert coord .attrs ["bin_type" ] == "Integer"
173173 assert coord .size == ax .extent
174174 assert "right_edge" not in coord .attrs
175- assert coord .attrs ["underflow" ] is underflow
176- assert coord .attrs ["overflow" ] is overflow
175+ assert coord .attrs ["underflow" ] is int ( underflow )
176+ assert coord .attrs ["overflow" ] is int ( overflow )
177177 if underflow or overflow :
178178 assert np .isdtype (coord .dtype , kind = "signed integer" )
179179 slc = slice (1 if underflow else 0 , - 1 if overflow else None )
@@ -197,8 +197,8 @@ def test_intcat_bool(self, overflow: bool):
197197 coord = hist ["var1_bins" ]
198198 assert coord .size == 3 if overflow else 2
199199 assert coord .attrs ["bin_type" ] == "IntCategory"
200- assert coord .attrs ["underflow" ] is False
201- assert coord .attrs ["overflow" ] is overflow
200+ assert coord .attrs ["underflow" ] == 0
201+ assert coord .attrs ["overflow" ] is int ( overflow )
202202 if overflow :
203203 assert np .isdtype (coord .dtype , kind = "signed integer" )
204204 assert_allclose (coord [:- 1 ], [0 , 1 ])
@@ -515,7 +515,3 @@ def test_partial_dask(self):
515515 ref = get_ref_hist (x , y , axes = axes )
516516
517517 assert_allclose (hist .to_numpy (), ref , atol = 1 , rtol = 1e-6 )
518-
519-
520- class TestFlowBins :
521- pass
0 commit comments