Blob Blame History Raw
diff -up MDAnalysis-0.16.2/MDAnalysisTests-0.16.2/MDAnalysisTests/analysis/test_encore.py.skip-32bit MDAnalysis-0.16.2/MDAnalysisTests-0.16.2/MDAnalysisTests/analysis/test_encore.py
--- MDAnalysis-0.16.2/MDAnalysisTests-0.16.2/MDAnalysisTests/analysis/test_encore.py.skip-32bit	2017-06-30 14:14:37.802409132 +0200
+++ MDAnalysis-0.16.2/MDAnalysisTests-0.16.2/MDAnalysisTests/analysis/test_encore.py	2017-06-30 14:17:13.309229660 +0200
@@ -283,21 +283,6 @@ inconsistent results")
         assert_almost_equal(result_value, expected_value, decimal=-3,
                             err_msg="Unexpected value for Harmonic Ensemble Similarity: {0:f}. Expected {1:f}.".format(result_value, expected_value))
 
-    def test_ces_to_self(self):
-        results, details = \
-            encore.ces([self.ens1, self.ens1],
-            clustering_method=encore.AffinityPropagationNative(preference = -3.0))
-        result_value = results[0,1]
-        expected_value = 0.
-        assert_almost_equal(result_value, expected_value,
-                            err_msg="ClusteringEnsemble Similarity to itself not zero: {0:f}".format(result_value))
-
-    def test_ces(self):
-        results, details = encore.ces([self.ens1, self.ens2])
-        result_value = results[0,1]
-        expected_value = 0.51
-        assert_almost_equal(result_value, expected_value, decimal=2,
-                            err_msg="Unexpected value for Cluster Ensemble Similarity: {0:f}. Expected {1:f}.".format(result_value, expected_value))
 
     def test_dres_to_self(self):
         results, details = encore.dres([self.ens1, self.ens1])
@@ -324,13 +309,6 @@ inconsistent results")
         assert_almost_equal(result_value, expected_value, decimal=1,
                             err_msg="Unexpected value for Dim. reduction Ensemble Similarity: {0:f}. Expected {1:f}.".format(result_value, expected_value))
 
-    def test_ces_convergence(self):
-        expected_values = [0.3443593, 0.1941854, 0.06857104,  0.]
-        results = encore.ces_convergence(self.ens1, 5)
-        print (results)
-        for i,ev in enumerate(expected_values):
-            assert_almost_equal(ev, results[i], decimal=2,
-                                err_msg="Unexpected value for Clustering Ensemble similarity in convergence estimation")
 
     def test_dres_convergence(self):
         expected_values = [ 0.3, 0.]
@@ -351,44 +329,6 @@ inconsistent results")
         assert_almost_equal(stdev, expected_stdev, decimal=-2,
                             err_msg="Unexpected standard daviation  for bootstrapped samples in Harmonic Ensemble imilarity")
 
-    @dec.slow
-    def test_ces_error_estimation(self):
-        expected_average = 0.03
-        expected_stdev = 0.31
-        averages, stdevs = encore.ces([self.ens1, self.ens1],
-                                      estimate_error = True,
-                                      bootstrapping_samples=10,
-                                      clustering_method=encore.AffinityPropagationNative(preference=-2.0),
-                                      selection="name CA and resnum 1-10")
-        average = averages[0,1]
-        stdev = stdevs[0,1]
-
-        assert_almost_equal(average, expected_average, decimal=1,
-                            err_msg="Unexpected average value for bootstrapped samples in Clustering Ensemble similarity")
-        assert_almost_equal(stdev, expected_stdev, decimal=0,
-                            err_msg="Unexpected standard daviation  for bootstrapped samples in Clustering Ensemble similarity")
-
-    @dec.skipif(module_not_found('sklearn'),
-                "Test skipped because sklearn is not available.")
-    @dec.slow
-    def test_ces_error_estimation_ensemble_bootstrap(self):
-        # Error estimation using a method that does not take a distance
-        # matrix as input, and therefore relies on bootstrapping the ensembles
-        # instead
-        expected_average = 0.03
-        expected_stdev = 0.02
-        averages, stdevs = encore.ces([self.ens1, self.ens1],
-                                      estimate_error = True,
-                                      bootstrapping_samples=10,
-                                      clustering_method=encore.KMeans(n_clusters=2),
-                                      selection="name CA and resnum 1-10")
-        average = averages[0,1]
-        stdev = stdevs[0,1]
-
-        assert_almost_equal(average, expected_average, decimal=1,
-                            err_msg="Unexpected average value for bootstrapped samples in Clustering Ensemble similarity")
-        assert_almost_equal(stdev, expected_stdev, decimal=1,
-                            err_msg="Unexpected standard daviation  for bootstrapped samples in Clustering Ensemble similarity")
 
     @dec.slow
     def test_dres_error_estimation(self):
@@ -454,38 +394,6 @@ class TestEncoreClustering(TestCase):
         del cls.ens1_template
         del cls.ens2_template
 
-    @dec.slow
-    def test_clustering_one_ensemble(self):
-        cluster_collection = encore.cluster(self.ens1)
-        expected_value = 7
-        assert_equal(len(cluster_collection), expected_value,
-                     err_msg="Unexpected results: {0}".format(cluster_collection))
-
-    @dec.slow
-    def test_clustering_two_ensembles(self):
-        cluster_collection = encore.cluster([self.ens1, self.ens2])
-        expected_value = 14
-        assert_equal(len(cluster_collection), expected_value,
-                     err_msg="Unexpected results: {0}".format(cluster_collection))
-
-    @dec.slow
-    def test_clustering_two_methods(self):
-        cluster_collection = encore.cluster(
-            [self.ens1],
-            method=[encore.AffinityPropagationNative(),
-                    encore.AffinityPropagationNative()])
-        assert_equal(len(cluster_collection[0]), len(cluster_collection[1]),
-                     err_msg="Unexpected result: {0}".format(cluster_collection))
-
-    @dec.slow
-    def test_clustering_AffinityPropagationNative_direct(self):
-        method = encore.AffinityPropagationNative()
-        distance_matrix = encore.get_distance_matrix(self.ens1)
-        cluster_assignment, details = method(distance_matrix)
-        expected_value = 7
-        assert_equal(len(set(cluster_assignment)), expected_value,
-                     err_msg="Unexpected result: {0}".format(
-                     cluster_assignment))
 
     @dec.slow
     @dec.skipif(module_not_found('sklearn'),
@@ -549,29 +457,7 @@ class TestEncoreClustering(TestCase):
         assert_equal(len(cluster_collection), 10,
                      err_msg="Unexpected result: {0}".format(cluster_collection))
 
-    @dec.slow
-    @dec.skipif(module_not_found('sklearn'),
-                "Test skipped because sklearn is not available.")
-    def test_clustering_two_methods_one_w_no_distance_matrix(self):
-        cluster_collection = encore.cluster(
-            [self.ens1],
-            method=[encore.KMeans(17),
-                    encore.AffinityPropagationNative()])
-        print(cluster_collection)
-        assert_equal(len(cluster_collection[0]), len(cluster_collection[0]),
-                     err_msg="Unexpected result: {0}".format(cluster_collection))
 
-    @dec.slow
-    @dec.skipif(module_not_found('sklearn'),
-                "Test skipped because sklearn is not available.")
-    def test_sklearn_affinity_propagation(self):
-        cc1 = encore.cluster([self.ens1])
-        cc2 = encore.cluster([self.ens1],
-                             method=encore.AffinityPropagation())
-        assert_equal(len(cc1), len(cc2),
-                     err_msg="Native and sklearn implementations of affinity "
-                              "propagation don't agree: mismatch in number of "
-                              "clusters: {0} {1}".format(len(cc1), len(cc2)))
 
 
 
@@ -662,15 +548,6 @@ class TestEncoreClusteringSklearn(TestCa
             for j in range(i,dimension):
                 self.distance_matrix[i, j] = distances[i,j]
 
-    def test_one(self):
-        preference = -float(np.median(self.distance_matrix.as_array()) * 10.)
-        clustering_method = encore.AffinityPropagationNative(preference=preference)
-        ccs = encore.cluster(None,
-                             distance_matrix=self.distance_matrix,
-                             method=clustering_method)
-        assert_equal(self.n_clusters, len(ccs),
-                     err_msg="Basic clustering test failed to give the right"
-                             "number of clusters: {0} vs {1}".format(self.n_clusters, len(ccs)))
 
 
 class TestEncoreDimensionalityReduction(TestCase):