@@ -44,39 +44,39 @@ def test_wrong_basis(self):
4444 def test_gaussian_evaluation (self ):
4545 rbf = nd .RBF (basis = 'gaussian_spline' , radius = 1. )
4646 result = rbf .basis (X = 1. , r = 1. )
47- assert result == 0.36787944117144233
47+ np . testing . assert_almost_equal ( result , 0.36787944117144233 )
4848
4949 def test_biharmonic_evaluation (self ):
5050 rbf = nd .RBF (basis = 'multi_quadratic_biharmonic_spline' , radius = 1. )
5151 result = rbf .basis (X = 1. , r = 1. )
52- assert result == 1.4142135623730951
52+ np . testing . assert_almost_equal ( result , 1.4142135623730951 )
5353
5454 def test_inv_biharmonic_evaluation (self ):
5555 rbf = nd .RBF (basis = 'inv_multi_quadratic_biharmonic_spline' , radius = 1. )
5656 result = rbf .basis (X = 1. , r = 1. )
57- assert result == 0.7071067811865475
57+ np . testing . assert_almost_equal ( result , 0.7071067811865475 )
5858
5959 def test_thin_plate_evaluation (self ):
6060 rbf = nd .RBF (basis = 'thin_plate_spline' , radius = 1. )
6161 result = rbf .basis (X = 1. , r = 0.5 )
62- assert result == 2.772588722239781
62+ np . testing . assert_almost_equal ( result , 2.772588722239781 )
6363
6464 def test_wendland_evaluation (self ):
6565 rbf = nd .RBF (basis = 'beckert_wendland_c2_basis' , radius = 1. )
6666 result = rbf .basis (X = 1. , r = 2. )
67- assert result == 0.1875
67+ np . testing . assert_almost_equal ( result , 0.1875 )
6868
6969 def test_wendland_outside_cutoff (self ):
7070 rbf = nd .RBF (basis = 'beckert_wendland_c2_basis' , radius = 1. )
7171 result = rbf .basis (X = 2. , r = 1. )
72- assert result == 0.0
72+ np . testing . assert_almost_equal ( result , 0.0 )
7373
7474 def test_weight_matrix (self ):
7575 x = np .arange (10 )
7676 rbf = nd .RBF (basis = 'beckert_wendland_c2_basis' , radius = 1. )
7777 weights_matrix = rbf .weights_matrix (X1 = x , X2 = x )
7878 expected = np .diag (np .ones (10 ))
79- np .testing .assert_array_equal (weights_matrix , expected )
79+ np .testing .assert_array_almost_equal (weights_matrix , expected )
8080
8181 def test_reconstruct_f_gaussian (self ):
8282 x , y , xx , yy = sample_data ()
@@ -91,7 +91,7 @@ def test_reconstruct_f_gaussian(self):
9191 # for argmin(yy) nearest to point y=20.25, where y=x*x
9292 idx = (np .abs (xx - 4.5 )).argmin ()
9393 idx2 = (np .abs (yy - 20.25 )).argmin ()
94- assert idx == idx2
94+ np . testing . assert_array_almost_equal ( idx , idx2 )
9595
9696 def test_reconstruct_f_biharmonic (self ):
9797 x , y , xx , yy = sample_data ()
@@ -106,7 +106,7 @@ def test_reconstruct_f_biharmonic(self):
106106 # for argmin(yy) nearest to point y=20.25, where y=x*x
107107 idx = (np .abs (xx - 4.5 )).argmin ()
108108 idx2 = (np .abs (yy - 20.25 )).argmin ()
109- assert idx == idx2
109+ np . testing . assert_array_almost_equal ( idx , idx2 )
110110
111111 def test_reconstruct_f_inv_biharmonic (self ):
112112 x , y , xx , yy = sample_data ()
@@ -121,7 +121,7 @@ def test_reconstruct_f_inv_biharmonic(self):
121121 # for argmin(yy) nearest to point y=20.25, where y=x*x
122122 idx = (np .abs (xx - 4.5 )).argmin ()
123123 idx2 = (np .abs (yy - 20.25 )).argmin ()
124- assert idx == idx2
124+ np . testing . assert_array_almost_equal ( idx , idx2 )
125125
126126 def test_reconstruct_f_plate (self ):
127127 x , y , xx , yy = sample_data ()
@@ -136,7 +136,7 @@ def test_reconstruct_f_plate(self):
136136 # for argmin(yy) nearest to point y=20.25, where y=x*x
137137 idx = (np .abs (xx - 4.5 )).argmin ()
138138 idx2 = (np .abs (yy - 20.25 )).argmin ()
139- assert idx == idx2
139+ np . testing . assert_array_almost_equal ( idx , idx2 )
140140
141141 def test_reconstruct_f_wendland (self ):
142142 x , y , xx , yy = sample_data ()
@@ -151,7 +151,7 @@ def test_reconstruct_f_wendland(self):
151151 # for argmin(yy) nearest to point y=20.25, where y=x*x
152152 idx = (np .abs (xx - 4.5 )).argmin ()
153153 idx2 = (np .abs (yy - 20.25 )).argmin ()
154- assert idx == idx2
154+ np . testing . assert_array_almost_equal ( idx , idx2 )
155155
156156 def test_reconstruct_f_scalar (self ):
157157 x = np .arange (10 )
0 commit comments