summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNathan Cassereau <84033440+ncassereau-idris@users.noreply.github.com>2022-11-21 17:27:50 +0100
committerGitHub <noreply@github.com>2022-11-21 17:27:50 +0100
commitfa0d4f2afff73284f4b79bfebb085eed332c112f (patch)
tree2b4f175da95f9a4097ca0ab1513b71862a9ee610 /test
parente433775c2015eb85c2683b6955618c2836f001bc (diff)
[MRG] Replaces numpy compiler with setuptools (#409)
* Numpy ccompiler deprecation handled with setuptools ccompiler * Remove useless OMP Macro, already provides _OPENMP * RELEASES.md * Remove forgotten temporary bug added for logging purposes
Diffstat (limited to 'test')
-rw-r--r--test/test_ot.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_ot.py b/test/test_ot.py
index 9a4e175..f2338ac 100644
--- a/test/test_ot.py
+++ b/test/test_ot.py
@@ -204,6 +204,22 @@ def test_emd_emd2():
np.testing.assert_allclose(w, 0)
+def test_omp_emd2():
+ # test emd2 and emd2 with openmp for simple identity
+ n = 100
+ rng = np.random.RandomState(0)
+
+ x = rng.randn(n, 2)
+ u = ot.utils.unif(n)
+
+ M = ot.dist(x, x)
+
+ w = ot.emd2(u, u, M)
+ w2 = ot.emd2(u, u, M, numThreads=2)
+
+ np.testing.assert_allclose(w, w2)
+
+
def test_emd_empty():
# test emd and emd2 for simple identity
n = 100