From 4d0280557cec3e1f52b72479d40aaf275d77ffc3 Mon Sep 17 00:00:00 2001 From: Brandon Amos Date: Sun, 16 Oct 2016 01:32:00 -0400 Subject: [PATCH] Revert "Update tests to use numpy.testing" This reverts commit 882109c1410e03af79efd5479dcdac17473efc8d. --- tests/openface_api_tests.py | 4 ++-- tests/openface_batch_represent_tests.py | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/openface_api_tests.py b/tests/openface_api_tests.py index 5f68c6780..cb4dde748 100644 --- a/tests/openface_api_tests.py +++ b/tests/openface_api_tests.py @@ -19,7 +19,6 @@ import os import numpy as np -import numpy.testing as npt np.set_printoptions(precision=2) import scipy @@ -64,4 +63,5 @@ def test_pipeline(): rep = net.forward(alignedFace) cosDist = scipy.spatial.distance.cosine(rep, np.ones(128)) - npt.assert_almost_equal(cosDist, 0.938840385931) + print(cosDist) + assert np.isclose(cosDist, 0.938840385931) diff --git a/tests/openface_batch_represent_tests.py b/tests/openface_batch_represent_tests.py index 662a29b79..e1cd261bf 100644 --- a/tests/openface_batch_represent_tests.py +++ b/tests/openface_batch_represent_tests.py @@ -20,7 +20,6 @@ import tempfile import numpy as np -import numpy.testing as npt np.set_printoptions(precision=2) import pandas as pd import scipy @@ -87,6 +86,6 @@ def test_batch_represent(): cosDist = scipy.spatial.distance.cosine(brody1, brody2) print('cosDist:', cosDist) - npt.assert_almost_equal(cosDist, 0.1568, decimal=4) + assert np.isclose(cosDist, 0.1568, atol=1e-4) shutil.rmtree(workDir)