DmitryUlyanov / Multicore-TSNE

Parallel t-SNE implementation with Python and Torch wrappers.
Other
1.88k stars 229 forks source link

signature of sklearn.datasets.make_blobs has changed #90

Open mcepl opened 2 years ago

mcepl commented 2 years ago

When running the test suite while packaging this package for openSUSE/Factory, test_base.TestMulticoreTSNE.setUpClass errors:

[   54s] ======================================================================
[   54s] ERROR: setUpClass (test_base.TestMulticoreTSNE)
[   54s] ----------------------------------------------------------------------
[   54s] Traceback (most recent call last):
[   54s]   File "/home/abuild/rpmbuild/BUILD/MulticoreTSNE-0.1/MulticoreTSNE/tests/test_base.py", line 24, in setUpClass
[   54s]     cls.Xy = make_blobs(20, 100, 2, shuffle=False)
[   54s] TypeError: make_blobs() takes from 0 to 2 positional arguments but 3 positional arguments (and 2 keyword-only arguments) were given
[   54s] 
[   54s] ----------------------------------------------------------------------

The problem is that the signature of the function has changed and only the first parameters are positional. This patch seems to help:

---
 MulticoreTSNE/tests/test_base.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/MulticoreTSNE/tests/test_base.py
+++ b/MulticoreTSNE/tests/test_base.py
@@ -21,7 +21,7 @@ def pdist(X):
 class TestMulticoreTSNE(unittest.TestCase):
     @classmethod
     def setUpClass(cls):
-        cls.Xy = make_blobs(20, 100, 2, shuffle=False)
+        cls.Xy = make_blobs(20, 100, centers=2, shuffle=False)

     def test_tsne(self):
         X, y = self.Xy