@@ -22,7 +22,7 @@ def f(i):
22
22
23
23
l2 = list (ot .utils .parmap (f , a ))
24
24
25
- assert np .allclose (l1 , l2 )
25
+ np .testing . assert_allclose (l1 , l2 )
26
26
27
27
28
28
def test_tic_toc ():
@@ -35,10 +35,10 @@ def test_tic_toc():
35
35
t2 = ot .toq ()
36
36
37
37
# test timing
38
- assert np .allclose (0.5 , t , rtol = 1e-2 , atol = 1e-2 )
38
+ np .testing . assert_allclose (0.5 , t , rtol = 1e-2 , atol = 1e-2 )
39
39
40
40
# test toc vs toq
41
- assert np .allclose (t , t2 , rtol = 1e-2 , atol = 1e-2 )
41
+ np .testing . assert_allclose (t , t2 , rtol = 1e-2 , atol = 1e-2 )
42
42
43
43
44
44
def test_kernel ():
@@ -50,7 +50,7 @@ def test_kernel():
50
50
K = ot .utils .kernel (x , x )
51
51
52
52
# gaussian kernel has ones on the diagonal
53
- assert np .allclose (np .diag (K ), np .ones (n ))
53
+ np .testing . assert_allclose (np .diag (K ), np .ones (n ))
54
54
55
55
56
56
def test_unif ():
@@ -59,7 +59,7 @@ def test_unif():
59
59
60
60
u = ot .unif (n )
61
61
62
- assert np .allclose (1 , np .sum (u ))
62
+ np .testing . assert_allclose (1 , np .sum (u ))
63
63
64
64
65
65
def test_dist ():
@@ -77,8 +77,8 @@ def test_dist():
77
77
D3 = ot .dist (x )
78
78
79
79
# dist shoul return squared euclidean
80
- assert np .allclose (D , D2 )
81
- assert np .allclose (D , D3 )
80
+ np .testing . assert_allclose (D , D2 )
81
+ np .testing . assert_allclose (D , D3 )
82
82
83
83
84
84
def test_dist0 ():
@@ -87,7 +87,7 @@ def test_dist0():
87
87
M = ot .utils .dist0 (n , method = 'lin_square' )
88
88
89
89
# dist0 default to linear sampling with quadratic loss
90
- assert np .allclose (M [0 , - 1 ], (n - 1 ) * (n - 1 ))
90
+ np .testing . assert_allclose (M [0 , - 1 ], (n - 1 ) * (n - 1 ))
91
91
92
92
93
93
def test_dots ():
@@ -102,7 +102,7 @@ def test_dots():
102
102
103
103
X2 = A .dot (B .dot (C ))
104
104
105
- assert np .allclose (X1 , X2 )
105
+ np .testing . assert_allclose (X1 , X2 )
106
106
107
107
108
108
def test_clean_zeros ():
0 commit comments