1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
From: Nilesh Patra <nilesh@debian.org>
Date: Sun, 12 Feb 2023 01:31:00 +0530
Subject: Some tests fail on arm, skip.
pynndescent/tests/test_distances.py | 10 ++++++++++
pynndescent/tests/test_pynndescent_.py | 4 ++++
pynndescent/tests/test_rank.py | 4 ++++
3 files changed, 18 insertions(+)
diff --git a/pynndescent/tests/test_distances.py b/pynndescent/tests/test_distances.py
index 83898a1..d366446 100644
@@ -9,6 +9,7 @@ from scipy.version import full_version as scipy_full_version
from sklearn.metrics import pairwise_distances
from sklearn.neighbors import BallTree
from sklearn.preprocessing import normalize
+import platform
@pytest.mark.parametrize(
@@ -106,6 +107,9 @@ def test_binary_check(binary_data, metric):
],
)
def test_sparse_spatial_check(sparse_spatial_data, metric, decimal=6):
+ machine = platform.machine()
+ if (machine.startswith('arm') or machine.startswith('aarch')):
+ pytest.skip("Skip on arm")
if metric in spdist.sparse_named_distances:
dist_matrix = pairwise_distances(
np.asarray(sparse_spatial_data.todense()).astype(np.float32), metric=metric
@@ -331,6 +335,9 @@ def test_alternative_distances():
def test_jensen_shannon():
+ machine = platform.machine()
+ if (machine.startswith('arm') or machine.startswith('aarch')):
+ pytest.skip()
test_data = np.random.random(size=(10, 50))
test_data = normalize(test_data, norm="l1")
for i in range(test_data.shape[0]):
@@ -347,6 +354,9 @@ def test_jensen_shannon():
def test_sparse_jensen_shannon():
+ machine = platform.machine()
+ if (machine.startswith('arm') or machine.startswith('aarch')):
+ pytest.skip()
test_data = np.random.random(size=(10, 100))
# sparsify
test_data[test_data <= 0.5] = 0.0
diff --git a/pynndescent/tests/test_pynndescent_.py b/pynndescent/tests/test_pynndescent_.py
index b36fded..6be146b 100644
@@ -11,9 +11,13 @@ from sklearn.preprocessing import normalize
import pickle
import joblib
import scipy
+import platform
from pynndescent import NNDescent, PyNNDescentTransformer
+machine = platform.machine()
+if (machine.startswith('arm') or machine.startswith('aarch')):
+ pytest.skip("Skip on arm", allow_module_level=True)
def test_nn_descent_neighbor_accuracy(nn_data, seed):
knn_indices, _ = NNDescent(
diff --git a/pynndescent/tests/test_rank.py b/pynndescent/tests/test_rank.py
index e75d96a..6e89798 100644
@@ -1,9 +1,13 @@
import pytest
import numpy as np
+import platform
from numpy.testing import assert_array_equal
from pynndescent.distances import rankdata
+machine = platform.machine()
+if (machine.startswith('arm') or machine.startswith('aarch')):
+ pytest.skip("Skip on arm", allow_module_level=True)
def test_empty():
"""rankdata([]) should return an empty array."""
|