[Scipy-svn] r5052 - trunk/scipy/cluster/tests

scipy-svn@scip... scipy-svn@scip...
Mon Nov 10 11:45:51 CST 2008


Author: damian.eads
Date: 2008-11-10 11:45:49 -0600 (Mon, 10 Nov 2008)
New Revision: 5052

Modified:
   trunk/scipy/cluster/tests/test_hierarchy.py
Log:
Casted expected array from data file from float to int.

Modified: trunk/scipy/cluster/tests/test_hierarchy.py
===================================================================
--- trunk/scipy/cluster/tests/test_hierarchy.py	2008-11-10 16:55:40 UTC (rev 5051)
+++ trunk/scipy/cluster/tests/test_hierarchy.py	2008-11-10 17:45:49 UTC (rev 5052)
@@ -428,28 +428,28 @@
 
     def test_fclusterdata_maxclusts_2(self):
         "Tests fclusterdata(X, criterion='maxclust', t=2) on a random 3-cluster data set."
-        expectedT = eo['fclusterdata-maxclusts-2']
+        expectedT = np.int_(eo['fclusterdata-maxclusts-2'])
         X = eo['Q-X']
         T = fclusterdata(X, criterion='maxclust', t=2)
         self.failUnless(is_isomorphic(T, expectedT))
 
     def test_fclusterdata_maxclusts_3(self):
         "Tests fclusterdata(X, criterion='maxclust', t=3) on a random 3-cluster data set."
-        expectedT = eo['fclusterdata-maxclusts-3']
+        expectedT = np.int_(eo['fclusterdata-maxclusts-3'])
         X = eo['Q-X']
         T = fclusterdata(X, criterion='maxclust', t=3)
         self.failUnless(is_isomorphic(T, expectedT))
 
     def test_fclusterdata_maxclusts_4(self):
         "Tests fclusterdata(X, criterion='maxclust', t=4) on a random 3-cluster data set."
-        expectedT = eo['fclusterdata-maxclusts-4']
+        expectedT = np.int_(eo['fclusterdata-maxclusts-4'])
         X = eo['Q-X']
         T = fclusterdata(X, criterion='maxclust', t=4)
         self.failUnless(is_isomorphic(T, expectedT))
 
     def test_fcluster_maxclusts_2(self):
         "Tests fcluster(Z, criterion='maxclust', t=2) on a random 3-cluster data set."
-        expectedT = eo['fclusterdata-maxclusts-2']
+        expectedT = np.int_(eo['fclusterdata-maxclusts-2'])
         X = eo['Q-X']
         Y = pdist(X)
         Z = linkage(Y)
@@ -458,7 +458,7 @@
 
     def test_fcluster_maxclusts_3(self):
         "Tests fcluster(Z, criterion='maxclust', t=3) on a random 3-cluster data set."
-        expectedT = eo['fclusterdata-maxclusts-3']
+        expectedT = np.int_(eo['fclusterdata-maxclusts-3'])
         X = eo['Q-X']
         Y = pdist(X)
         Z = linkage(Y)
@@ -467,7 +467,7 @@
 
     def test_fcluster_maxclusts_4(self):
         "Tests fcluster(Z, criterion='maxclust', t=4) on a random 3-cluster data set."
-        expectedT = eo['fclusterdata-maxclusts-4']
+        expectedT = np.int_(eo['fclusterdata-maxclusts-4'])
         X = eo['Q-X']
         Y = pdist(X)
         Z = linkage(Y)
@@ -484,6 +484,7 @@
         T = fcluster(Z, criterion='maxclust', t=3)
         Lright = (np.array([53, 55, 56]), np.array([2, 3, 1]))
         L = leaders(Z, T)
+        print L, Lright, T
         self.failUnless((L[0] == Lright[0]).all() and (L[1] == Lright[1]).all())
 
 def help_single_inconsistent_depth(self, i):



More information about the Scipy-svn mailing list