[med-svn] [Git][med-team/umap-learn][master] prevent infinite test hang

Nilesh Patra (@nilesh) gitlab at salsa.debian.org
Sat Feb 11 07:46:17 GMT 2023



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


Commits:
f7e1319a by Nilesh Patra at 2023-02-11T07:45:50+00:00
prevent infinite test hang

- - - - -


3 changed files:

- debian/patches/fix-example.patch
- debian/tests/control
- debian/tests/run-unit-test


Changes:

=====================================
debian/patches/fix-example.patch
=====================================
@@ -23,21 +23,36 @@
  
  if "torus" in target_spaces:
      # embed onto a torus
-@@ -87,6 +88,7 @@
+@@ -86,7 +87,7 @@
+         x, y, z, y_train, colormap="spectral", scale_mode="none", scale_factor=0.1
      )
  
-     mlab.show()
-+    mlab.close()
+-    mlab.show()
++    mlab.savefig('torus.png')
  
  if "sphere" in target_spaces:
      # embed onto a sphere
-@@ -118,3 +120,4 @@
+@@ -117,4 +118,4 @@
+         x, y, z, y_train, colormap="spectral", scale_mode="none", scale_factor=0.2
      )
  
-     mlab.show()
-+    mlab.close()
+-    mlab.show()
++    mlab.savefig('sphere.png')
 --- a/examples/mnist_transform_new_data.py
 +++ b/examples/mnist_transform_new_data.py
+@@ -35,10 +35,10 @@
+ 
+ fig, ax = plt.subplots(1, 2, sharex=True, sharey=True, figsize=(12, 10))
+ ax[0].scatter(
+-    embedding_train[:, 0], embedding_train[:, 1], c=y_train, cmap="Spectral"  # , s=0.1
++    embedding_train[:, 0], embedding_train[:, 1], cmap="Spectral"  # , s=0.1
+ )
+ ax[1].scatter(
+-    embedding_test[:, 0], embedding_test[:, 1], c=y_test, cmap="Spectral"  # , s=0.1
++    embedding_test[:, 0], embedding_test[:, 1], cmap="Spectral"  # , s=0.1
+ )
+ plt.setp(ax[0], xticks=[], yticks=[])
+ plt.setp(ax[1], xticks=[], yticks=[])
 @@ -46,3 +46,4 @@
  ax[0].set_title("Training Set", fontsize=12)
  ax[1].set_title("Test Set", fontsize=12)


=====================================
debian/tests/control
=====================================
@@ -1,4 +1,4 @@
 Test-Command: xvfb-run --auto-servernum --server-num=20 -s "-screen 0 1600x1200x24 -ac +extension GLX +render -noreset" sh debian/tests/run-unit-test
-Depends: @, python3-all, python3-matplotlib, python3-numpy, python3-numba, python3-sklearn, python3-seaborn, mayavi2, xvfb, xauth
+Depends: @, file, python3-all, python3-matplotlib, python3-numpy, python3-numba, python3-sklearn, python3-seaborn, mayavi2, xvfb, xauth
 Restrictions: allow-stderr
 Architecture: amd64 arm64 kfreebsd-amd64 ppc64el ppc64 mips64el s390x ia64 riscv64 sparc64


=====================================
debian/tests/run-unit-test
=====================================
@@ -19,3 +19,6 @@ export MPLBACKEND=Agg
 python3 inverse_transform_example.py
 python3 mnist_torus_sphere_example.py
 python3 mnist_transform_new_data.py
+
+file torus.png | fgrep -q 'PNG'
+file sphere.png | fgrep -q 'PNG'



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

-- 
View it on GitLab: https://salsa.debian.org/med-team/umap-learn/-/commit/f7e1319ac9a6b7b3f982598e4cc54e0c3e536721
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/20230211/9db28464/attachment-0001.htm>


More information about the debian-med-commit mailing list