diff options
author | Otakar Jašek | 2020-09-06 17:38:51 +0200 |
---|---|---|
committer | Otakar Jašek | 2020-09-06 17:38:51 +0200 |
commit | 4a4cfa8f32852702b70078a501e31409769ac843 (patch) | |
tree | 388948935dec7ab6b07d9c47e272867acd28032b | |
parent | d9687454331cd6aacf56e648edbaefb65b974d45 (diff) | |
download | aur-4a4cfa8f32852702b70078a501e31409769ac843.tar.gz |
tests
-rw-r--r-- | .SRCINFO | 2 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rw-r--r-- | tests.patch | 13 |
3 files changed, 22 insertions, 2 deletions
@@ -16,7 +16,9 @@ pkgbase = faiss-git depends = openmp optdepends = intel-mkl source = faiss::git+https://github.com/facebookresearch/faiss.git + source = tests.patch sha256sums = SKIP + sha256sums = 0e90164da283d87b2ad176449b1ba441b7ce0c6343aa4dbb8d268483bf805ccd pkgname = faiss-git pkgdesc = A library for efficient similarity search and clustering of dense vectors. @@ -8,8 +8,10 @@ url="https://github.com/facebookresearch/faiss" license=('MIT') pkgver=1.6.1.r90.g9873376 pkgrel=1 -source=(${_pkgname}::git+https://github.com/facebookresearch/faiss.git) -sha256sums=('SKIP') +source=(${_pkgname}::git+https://github.com/facebookresearch/faiss.git + 'tests.patch') +sha256sums=('SKIP' + '0e90164da283d87b2ad176449b1ba441b7ce0c6343aa4dbb8d268483bf805ccd') depends=('blas' 'lapack' 'openmp') makedepends=('git' 'python' 'python-numpy' 'swig' 'python-setuptools' 'cmake') optdepends=('intel-mkl') @@ -22,6 +24,7 @@ pkgver() { prepare() { cd "${srcdir}/${_pkgname}" + patch -p1 < ../tests.patch # see https://github.com/facebookresearch/faiss/issues/1394 mkdir -p build cd build cmake .. \ @@ -35,6 +38,8 @@ prepare() { check() { cd "${srcdir}/${_pkgname}/build" make test + cd "${srcdir}/${_pkgname}/tests" + PYTHONPATH=../build/faiss/python:$PYTHONPATH pytest } build() { diff --git a/tests.patch b/tests.patch new file mode 100644 index 000000000000..49a259a10c06 --- /dev/null +++ b/tests.patch @@ -0,0 +1,13 @@ +diff --git a/tests/test_contrib.py b/tests/test_contrib.py +index 87155e9..ad9f64a 100644 +--- a/tests/test_contrib.py ++++ b/tests/test_contrib.py +@@ -32,7 +32,7 @@ class TestComputeGT(unittest.TestCase): + Dnew, Inew = knn_ground_truth(xq, matrix_iterator(xb, 1000), 10) + + np.testing.assert_array_equal(Iref, Inew) +- np.testing.assert_almost_equal(Dref, Dnew, decimal=5) ++ np.testing.assert_almost_equal(Dref, Dnew, decimal=4) + + + class TestDatasets(unittest.TestCase): |