Skip to content

Commit bd1af44

Browse files
committed
add test barycenter cvxopt
1 parent fdb2f3a commit bd1af44

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/test_ot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from ot.datasets import get_1D_gauss as gauss
1313
import pytest
1414

15+
1516
def test_doctest():
1617
import doctest
1718

@@ -133,6 +134,7 @@ def test_lp_barycenter():
133134
np.testing.assert_allclose(bary, bary0, rtol=1e-5, atol=1e-7)
134135
np.testing.assert_allclose(bary.sum(), 1)
135136

137+
136138
@pytest.mark.skipif(not ot.lp.cvx.cvxopt, reason="No cvxopt available")
137139
def test_lp_barycenter_cvxopt():
138140

@@ -145,11 +147,12 @@ def test_lp_barycenter_cvxopt():
145147
# obvious barycenter between two diracs
146148
bary0 = np.array([0, 1.0, 0])
147149

148-
bary = ot.lp.barycenter(A, M, [.5, .5],solver=None)
150+
bary = ot.lp.barycenter(A, M, [.5, .5], solver=None)
149151

150152
np.testing.assert_allclose(bary, bary0, rtol=1e-5, atol=1e-7)
151153
np.testing.assert_allclose(bary.sum(), 1)
152154

155+
153156
def test_warnings():
154157
n = 100 # nb bins
155158
m = 100 # nb bins

0 commit comments

Comments
 (0)