@@ -58,9 +58,7 @@ def test_linkage_misc():
5858
5959
6060def test_structured_linkage_tree ():
61- """
62- Check that we obtain the correct solution for structured linkage trees.
63- """
61+ # Check that we obtain the correct solution for structured linkage trees.
6462 rng = np .random .RandomState (0 )
6563 mask = np .ones ([10 , 10 ], dtype = np .bool )
6664 # Avoiding a mask with only 'True' entries
@@ -82,9 +80,7 @@ def test_structured_linkage_tree():
8280
8381
8482def test_unstructured_linkage_tree ():
85- """
86- Check that we obtain the correct solution for unstructured linkage trees.
87- """
83+ # Check that we obtain the correct solution for unstructured linkage trees.
8884 rng = np .random .RandomState (0 )
8985 X = rng .randn (50 , 100 )
9086 for this_X in (X , X [0 ]):
@@ -107,9 +103,7 @@ def test_unstructured_linkage_tree():
107103
108104
109105def test_height_linkage_tree ():
110- """
111- Check that the height of the results of linkage tree is sorted.
112- """
106+ # Check that the height of the results of linkage tree is sorted.
113107 rng = np .random .RandomState (0 )
114108 mask = np .ones ([10 , 10 ], dtype = np .bool )
115109 X = rng .randn (50 , 100 )
@@ -121,10 +115,8 @@ def test_height_linkage_tree():
121115
122116
123117def test_agglomerative_clustering ():
124- """
125- Check that we obtain the correct number of clusters with
126- agglomerative clustering.
127- """
118+ # Check that we obtain the correct number of clusters with
119+ # agglomerative clustering.
128120 rng = np .random .RandomState (0 )
129121 mask = np .ones ([10 , 10 ], dtype = np .bool )
130122 n_samples = 100
@@ -211,9 +203,7 @@ def test_agglomerative_clustering():
211203
212204
213205def test_ward_agglomeration ():
214- """
215- Check that we obtain the correct solution in a simplistic case
216- """
206+ # Check that we obtain the correct solution in a simplistic case
217207 rng = np .random .RandomState (0 )
218208 mask = np .ones ([10 , 10 ], dtype = np .bool )
219209 X = rng .randn (50 , 100 )
@@ -245,8 +235,7 @@ def assess_same_labelling(cut1, cut2):
245235
246236
247237def test_scikit_vs_scipy ():
248- """Test scikit linkage with full connectivity (i.e. unstructured) vs scipy
249- """
238+ # Test scikit linkage with full connectivity (i.e. unstructured) vs scipy
250239 n , p , k = 10 , 5 , 3
251240 rng = np .random .RandomState (0 )
252241
@@ -273,10 +262,8 @@ def test_scikit_vs_scipy():
273262
274263
275264def test_connectivity_propagation ():
276- """
277- Check that connectivity in the ward tree is propagated correctly during
278- merging.
279- """
265+ # Check that connectivity in the ward tree is propagated correctly during
266+ # merging.
280267 X = np .array ([(.014 , .120 ), (.014 , .099 ), (.014 , .097 ),
281268 (.017 , .153 ), (.017 , .153 ), (.018 , .153 ),
282269 (.018 , .153 ), (.018 , .153 ), (.018 , .153 ),
@@ -291,10 +278,8 @@ def test_connectivity_propagation():
291278
292279
293280def test_ward_tree_children_order ():
294- """
295- Check that children are ordered in the same way for both structured and
296- unstructured versions of ward_tree.
297- """
281+ # Check that children are ordered in the same way for both structured and
282+ # unstructured versions of ward_tree.
298283
299284 # test on five random datasets
300285 n , p = 10 , 5
@@ -313,7 +298,7 @@ def test_ward_tree_children_order():
313298
314299
315300def test_ward_linkage_tree_return_distance ():
316- """ Test return_distance option on linkage and ward trees"""
301+ # Test return_distance option on linkage and ward trees
317302
318303 # test that return_distance when set true, gives same
319304 # output on both structured and unstructured clustering.
@@ -420,10 +405,8 @@ def test_ward_linkage_tree_return_distance():
420405
421406
422407def test_connectivity_fixing_non_lil ():
423- """
424- Check non regression of a bug if a non item assignable connectivity is
425- provided with more than one component.
426- """
408+ # Check non regression of a bug if a non item assignable connectivity is
409+ # provided with more than one component.
427410 # create dummy data
428411 x = np .array ([[0 , 0 ], [1 , 1 ]])
429412 # create a mask with several components to force connectivity fixing
@@ -475,7 +458,7 @@ def test_connectivity_ignores_diagonal():
475458
476459
477460def test_compute_full_tree ():
478- """ Test that the full tree is computed if n_clusters is small"""
461+ # Test that the full tree is computed if n_clusters is small
479462 rng = np .random .RandomState (0 )
480463 X = rng .randn (10 , 2 )
481464 connectivity = kneighbors_graph (X , 5 , include_self = False )
@@ -502,7 +485,7 @@ def test_compute_full_tree():
502485
503486
504487def test_n_components ():
505- """ Test n_components returned by linkage, average and ward tree"""
488+ # Test n_components returned by linkage, average and ward tree
506489 rng = np .random .RandomState (0 )
507490 X = rng .rand (5 , 5 )
508491
0 commit comments