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

scipy-svn at scipy.org scipy-svn at scipy.org
Sun Oct 10 01:40:50 EDT 2010


Author: warren.weckesser
Date: 2010-10-10 00:40:50 -0500 (Sun, 10 Oct 2010)
New Revision: 6831

Modified:
   trunk/scipy/cluster/tests/test_hierarchy.py
Log:
TST: cluster: Don't use 'import *'. Rename tests with duplicate names. Remove unused imports.

Modified: trunk/scipy/cluster/tests/test_hierarchy.py
===================================================================
--- trunk/scipy/cluster/tests/test_hierarchy.py	2010-10-10 05:33:43 UTC (rev 6830)
+++ trunk/scipy/cluster/tests/test_hierarchy.py	2010-10-10 05:40:50 UTC (rev 6831)
@@ -36,9 +36,13 @@
 import os.path
 
 import numpy as np
-from numpy.testing import *
+from numpy.testing import TestCase, run_module_suite
 
-from scipy.cluster.hierarchy import linkage, from_mlab_linkage, to_mlab_linkage, num_obs_linkage, inconsistent, cophenet, from_mlab_linkage, fclusterdata, fcluster, is_isomorphic, single, complete, average, weighted, centroid, median, ward, leaders, correspond, is_monotonic, maxdists, maxinconsts, maxRstat, is_valid_linkage, is_valid_im, to_tree, leaves_list
+from scipy.cluster.hierarchy import linkage, from_mlab_linkage, to_mlab_linkage,\
+        num_obs_linkage, inconsistent, cophenet, fclusterdata, fcluster, \
+        is_isomorphic, single, complete, weighted, centroid, leaders, \
+        correspond, is_monotonic, maxdists, maxinconsts, maxRstat, \
+        is_valid_linkage, is_valid_im, to_tree, leaves_list
 from scipy.spatial.distance import squareform, pdist
 
 _tdist = np.array([[0,    662,  877,  255,  412,  996],
@@ -890,12 +894,12 @@
                         [4, 5, 0.2, 4]], dtype=np.double)
         self.assertTrue(is_monotonic(Z) == False)
 
-    def test_is_monotonic_tdist_linkage(self):
+    def test_is_monotonic_tdist_linkage1(self):
         "Tests is_monotonic(Z) on clustering generated by single linkage on tdist data set. Expecting True."
         Z = linkage(_ytdist, 'single')
         self.assertTrue(is_monotonic(Z) == True)
 
-    def test_is_monotonic_tdist_linkage(self):
+    def test_is_monotonic_tdist_linkage2(self):
         "Tests is_monotonic(Z) on clustering generated by single linkage on tdist data set. Perturbing. Expecting False."
         Z = linkage(_ytdist, 'single')
         Z[2,2]=0.0




More information about the Scipy-svn mailing list