[med-svn] [Git][med-team/umap-learn][master] [ci skip] attempt to fix tests

Nilesh Patra (@nilesh) gitlab at salsa.debian.org
Fri Feb 10 14:34:38 GMT 2023



Nilesh Patra pushed to branch master at Debian Med / umap-learn


Commits:
d5387a03 by Nilesh Patra at 2023-02-10T20:04:20+05:30
[ci skip] attempt to fix tests

- - - - -


14 changed files:

- debian/patches/3ca4cf8620e25ceb8b4602648f4092d7a904a282.patch
- debian/patches/588e1f724c9f5de528eb1500b0c85a1a609fe947.patch
- debian/patches/6c433a36e1811e5c6109ea3414e1916c2347955f.patch
- debian/patches/949abd082524fce8c45dfb147bcd8e8ef49eade3.patch
- debian/patches/a714b59bd9e2ca2e63312bc3491b2b037a42f2f2.patch
- debian/patches/c7d05683325589ad432a55e109cacb9d631cfaa9.patch
- debian/patches/disable-and-fix-incompatible-tests.patch
- + debian/patches/fix-example.patch
- debian/patches/fix_further_tests.patch
- debian/patches/numpy_1.24.patch
- debian/patches/series
- debian/patches/skip_tests_needing_tensorflow.patch
- debian/tests/control
- debian/tests/run-unit-test


Changes:

=====================================
debian/patches/3ca4cf8620e25ceb8b4602648f4092d7a904a282.patch
=====================================
@@ -7,11 +7,9 @@ Subject: [PATCH] Without numba we lose some accuracy; lower for coverage
  umap/tests/test_composite_models.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
-diff --git a/umap/tests/test_composite_models.py b/umap/tests/test_composite_models.py
-index 202a864b..c8e662b1 100644
 --- a/umap/tests/test_composite_models.py
 +++ b/umap/tests/test_composite_models.py
-@@ -25,12 +25,12 @@ def test_composite_trustworthiness(nn_data, iris_model):
+@@ -25,12 +25,12 @@
      model3 = model1 * model2
      trust = trustworthiness(data, model3.embedding_, n_neighbors=10)
      assert (


=====================================
debian/patches/588e1f724c9f5de528eb1500b0c85a1a609fe947.patch
=====================================
@@ -7,11 +7,9 @@ Subject: [PATCH] cast rows appropriately
  umap/utils.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/umap/utils.py b/umap/utils.py
-index 41332dee..6bdffc21 100644
 --- a/umap/utils.py
 +++ b/umap/utils.py
-@@ -156,7 +156,7 @@ def csr_unique(matrix, return_index=True, return_inverse=True, return_counts=Tru
+@@ -156,7 +156,7 @@
      unique_matrix[inverse]
      """
      lil_matrix = matrix.tolil()


=====================================
debian/patches/6c433a36e1811e5c6109ea3414e1916c2347955f.patch
=====================================
@@ -7,11 +7,9 @@ Subject: [PATCH] Update test_umap_on_iris.py
  umap/tests/test_umap_on_iris.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/umap/tests/test_umap_on_iris.py b/umap/tests/test_umap_on_iris.py
-index e215c1b9..ee921ac6 100644
 --- a/umap/tests/test_umap_on_iris.py
 +++ b/umap/tests/test_umap_on_iris.py
-@@ -73,7 +73,7 @@ def test_umap_trustworthiness_on_sphere_iris(
+@@ -70,7 +70,7 @@
          iris.data, projected_embedding, n_neighbors=10, metric="cosine"
      )
      assert (


=====================================
debian/patches/949abd082524fce8c45dfb147bcd8e8ef49eade3.patch
=====================================
@@ -7,11 +7,9 @@ Subject: [PATCH] Random_state in sklearn has more strict constraints now
  umap/tests/test_umap_ops.py | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
-diff --git a/umap/tests/test_umap_ops.py b/umap/tests/test_umap_ops.py
-index d01f7317..c3e88cc3 100644
 --- a/umap/tests/test_umap_ops.py
 +++ b/umap/tests/test_umap_ops.py
-@@ -292,7 +292,7 @@ def test_component_layout_options(nn_data):
+@@ -292,7 +292,7 @@
          n_components,
          component_labels,
          2,
@@ -20,7 +18,7 @@ index d01f7317..c3e88cc3 100644
          metric="precomputed",
          metric_kwds={"linkage": "single"},
      )
-@@ -301,7 +301,7 @@ def test_component_layout_options(nn_data):
+@@ -301,7 +301,7 @@
          n_components,
          component_labels,
          2,
@@ -29,7 +27,7 @@ index d01f7317..c3e88cc3 100644
          metric="precomputed",
          metric_kwds={"linkage": "average"},
      )
-@@ -310,7 +310,7 @@ def test_component_layout_options(nn_data):
+@@ -310,7 +310,7 @@
          n_components,
          component_labels,
          2,


=====================================
debian/patches/a714b59bd9e2ca2e63312bc3491b2b037a42f2f2.patch
=====================================
@@ -7,11 +7,9 @@ Subject: [PATCH] sklearn parwise distances doesn't support np.matrix anymore
  umap/tests/test_umap_metrics.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/umap/tests/test_umap_metrics.py b/umap/tests/test_umap_metrics.py
-index 506f4945..ced97086 100644
 --- a/umap/tests/test_umap_metrics.py
 +++ b/umap/tests/test_umap_metrics.py
-@@ -141,7 +141,7 @@ def sparse_binary_check(metric, sparse_binary_data):
+@@ -141,7 +141,7 @@
      assert (
          metric in spdist.sparse_named_distances
      ), f"{metric} not supported for sparse data"


=====================================
debian/patches/c7d05683325589ad432a55e109cacb9d631cfaa9.patch
=====================================
@@ -7,11 +7,9 @@ Subject: [PATCH] Sklearn pairwise_distances doesn't support np.matrix anymore
  umap/tests/test_umap_metrics.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/umap/tests/test_umap_metrics.py b/umap/tests/test_umap_metrics.py
-index ced97086..dd8f609c 100644
 --- a/umap/tests/test_umap_metrics.py
 +++ b/umap/tests/test_umap_metrics.py
-@@ -122,7 +122,7 @@ def sparse_spatial_check(metric, sparse_spatial_data):
+@@ -122,7 +122,7 @@
      assert (
          metric in spdist.sparse_named_distances
      ), f"{metric} not supported for sparse data"


=====================================
debian/patches/disable-and-fix-incompatible-tests.patch
=====================================
@@ -4,7 +4,7 @@ Description: This has changes in two files:
 Date: Thu, 14 Jan 2021 22:03:08 +0100
 --- a/umap/tests/test_plot.py
 +++ b/umap/tests/test_plot.py
-@@ -25,6 +25,7 @@ def mapper(iris):
+@@ -25,6 +25,7 @@
  # needed as there is no assertion nor
  # property verification.
  @plot_only


=====================================
debian/patches/fix-example.patch
=====================================
@@ -0,0 +1,46 @@
+diff --git a/examples/inverse_transform_example.py b/examples/inverse_transform_example.py
+index 1e9af6d..30c5c82 100755
+--- a/examples/inverse_transform_example.py
++++ b/examples/inverse_transform_example.py
+@@ -41,7 +41,6 @@ inv_transformed_points = trans.inverse_transform(test_pts)
+ plt.scatter(
+     trans.embedding_[:, 0],
+     trans.embedding_[:, 1],
+-    c=mnist.target,
+     cmap="Spectral",
+     s=0.25,
+ )
+diff --git a/examples/mnist_torus_sphere_example.py b/examples/mnist_torus_sphere_example.py
+index 26d6d59..6e5c372 100755
+--- a/examples/mnist_torus_sphere_example.py
++++ b/examples/mnist_torus_sphere_example.py
+@@ -32,6 +32,7 @@ if "plane" in target_spaces:
+         trans.embedding_[:, 0], trans.embedding_[:, 1], c=y_train, cmap="Spectral"
+     )
+     plt.show()
++    plt.close()
+ 
+ if "torus" in target_spaces:
+     # embed onto a torus
+@@ -87,6 +88,7 @@ if "torus" in target_spaces:
+     )
+ 
+     mlab.show()
++    mlab.close()
+ 
+ if "sphere" in target_spaces:
+     # embed onto a sphere
+@@ -118,3 +120,4 @@ if "sphere" in target_spaces:
+     )
+ 
+     mlab.show()
++    mlab.close()
+diff --git a/examples/mnist_transform_new_data.py b/examples/mnist_transform_new_data.py
+index 8c45236..1094b68 100755
+--- a/examples/mnist_transform_new_data.py
++++ b/examples/mnist_transform_new_data.py
+@@ -46,3 +46,4 @@ plt.suptitle("MNIST data embedded into two dimensions by UMAP", fontsize=18)
+ ax[0].set_title("Training Set", fontsize=12)
+ ax[1].set_title("Test Set", fontsize=12)
+ plt.show()
++plt.close()


=====================================
debian/patches/fix_further_tests.patch
=====================================
@@ -1,6 +1,6 @@
 --- a/umap/tests/test_densmap.py
 +++ b/umap/tests/test_densmap.py
-@@ -76,5 +76,5 @@ def test_densmap_trustworthiness_on_iris
+@@ -76,5 +76,5 @@
      embedding = densmap_iris_model.embedding_
      trust = trustworthiness(iris.data, embedding, n_neighbors=10)
      assert (


=====================================
debian/patches/numpy_1.24.patch
=====================================
@@ -1,6 +1,6 @@
 --- a/umap/umap_.py
 +++ b/umap/umap_.py
-@@ -2375,9 +2375,9 @@ class UMAP(BaseEstimator):
+@@ -2375,9 +2375,9 @@
                  raise ValueError("Non-zero distances from samples to themselves!")
              if self.knn_dists is None:
                  self._knn_indices = np.zeros(


=====================================
debian/patches/series
=====================================
@@ -8,3 +8,4 @@ fix_further_tests.patch
 numpy_1.24.patch
 949abd082524fce8c45dfb147bcd8e8ef49eade3.patch
 588e1f724c9f5de528eb1500b0c85a1a609fe947.patch
+fix-example.patch


=====================================
debian/patches/skip_tests_needing_tensorflow.patch
=====================================
@@ -4,7 +4,7 @@ Description: Properly skip tests needing tensorflow
 
 --- a/umap/tests/test_parametric_umap.py
 +++ b/umap/tests/test_parametric_umap.py
-@@ -10,7 +10,7 @@ try:
+@@ -10,7 +10,7 @@
      import tensorflow as tf
  
      IMPORT_TF = True


=====================================
debian/tests/control
=====================================
@@ -1,4 +1,4 @@
 Tests: run-unit-test
-Depends: @, python3-all, python3-matplotlib, python3-numpy, python3-numba, python3-sklearn
+Depends: @, python3-all, python3-matplotlib, python3-numpy, python3-numba, python3-sklearn, python3-seaborn, mayavi2
 Restrictions: allow-stderr
 Architecture: amd64 arm64 kfreebsd-amd64 ppc64el ppc64 mips64el s390x ia64 riscv64 sparc64


=====================================
debian/tests/run-unit-test
=====================================
@@ -15,6 +15,7 @@ gunzip -r *
 
 # python3 umap_example.py
 set -x
+export MPLBACKEND=Agg
 python3 inverse_transform_example.py
 python3 mnist_torus_sphere_example.py
 python3 mnist_transform_new_data.py



View it on GitLab: https://salsa.debian.org/med-team/umap-learn/-/commit/d5387a0355d9a7f8b68520e5fc4decf2e0cd659e

-- 
View it on GitLab: https://salsa.debian.org/med-team/umap-learn/-/commit/d5387a0355d9a7f8b68520e5fc4decf2e0cd659e
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20230210/bf4054c6/attachment-0001.htm>


More information about the debian-med-commit mailing list