@@ -142,7 +142,7 @@ def test_linear_extrapolation(self):
142142
143143 x_linear = x1 [x1 < 1 ]
144144 y_linear = y1 [x1 < 1 ]
145- self .assertAlmostEqual (np .sum (y_linear - x_linear ), 0 )
145+ self .assertAlmostEqual (float ( np .sum (y_linear - x_linear ) ), 0 )
146146
147147 def test_linear_extrapolation_with_different_y (self ):
148148 x = np .arange (1 , 5.05 , 0.05 )
@@ -197,7 +197,7 @@ def test_extrapolate_to_zero_poly(self):
197197 y_expected = a * (x_extrapolate - c ) + b * (x_extrapolate - c ) ** 2
198198 y_expected [x_extrapolate < c ] = 0
199199
200- self .assertAlmostEqual (np .sum (y_extrapolate - y_expected ), 0 )
200+ self .assertAlmostEqual (float ( np .sum (y_extrapolate - y_expected )), 0. 0 )
201201
202202 extrapolated_pattern = extrapolate_to_zero_poly (pattern , x_max , replace = True )
203203 x1 , y1 = extrapolated_pattern .data
@@ -208,7 +208,7 @@ def test_extrapolate_to_zero_poly(self):
208208 y_expected = a * (x_extrapolate - c ) + b * (x_extrapolate - c ) ** 2
209209 y_expected [x_extrapolate < c ] = 0
210210
211- self .assertAlmostEqual (np .sum (y_extrapolate - y_expected ), 0 )
211+ self .assertAlmostEqual (float ( np .sum (y_extrapolate - y_expected ) ), 0 )
212212
213213 def test_extrapolate_to_zero_poly_with_different_y (self ):
214214 x = np .arange (1 , 5.05 , 0.05 )
@@ -290,9 +290,9 @@ def test_calculate_effective_form_factor(self):
290290 self .assertEqual (len (q ), len (effective_form_factor ))
291291
292292 effective_form_factor = calculate_effective_form_factor (
293- composition , 0 , sf_source = "hajdu"
293+ composition , np . array ([ 0 ]) , sf_source = "hajdu"
294294 )
295- self .assertAlmostEqual (effective_form_factor , 1.0 , places = 3 )
295+ self .assertAlmostEqual (float ( effective_form_factor [ 0 ]) , 1.0 , places = 3 )
296296
297297 def test_calculate_wkm_form_factor (self ):
298298 q = 0.0
0 commit comments