@@ -358,19 +358,26 @@ def test_nngraph(self, n_vertices=30):
358358 for backend in backends :
359359 for metric in metrics :
360360 for kind in ['knn' , 'radius' ]:
361- params = dict (features = features , metric = metric ,
362- order = order , kind = kind , backend = backend )
363361 # Unsupported combinations.
364362 if backend == 'flann' and metric == 'max_dist' :
365- self .assertRaises (ValueError , graphs .NNGraph , ** params )
363+ self .assertRaises (ValueError , graphs .NNGraph , features ,
364+ metric = metric , backend = backend )
366365 elif backend == 'nmslib' and metric == 'minkowski' :
367- self .assertRaises (ValueError , graphs .NNGraph , ** params )
366+ self .assertRaises (ValueError , graphs .NNGraph , features ,
367+ metric = metric , backend = backend )
368368 elif backend == 'nmslib' and kind == 'radius' :
369- self .assertRaises (ValueError , graphs .NNGraph , ** params )
369+ self .assertRaises (ValueError , graphs .NNGraph , features ,
370+ kind = kind , backend = backend )
370371 else :
371- graphs .NNGraph (** params , center = False )
372- graphs .NNGraph (** params , rescale = False )
373- graphs .NNGraph (** params , center = False , rescale = False )
372+ graphs .NNGraph (features , metric = metric , order = order ,
373+ kind = kind , backend = backend ,
374+ center = False )
375+ graphs .NNGraph (features , metric = metric , order = order ,
376+ kind = kind , backend = backend ,
377+ rescale = False )
378+ graphs .NNGraph (features , metric = metric , order = order ,
379+ kind = kind , backend = backend ,
380+ center = False , rescale = False )
374381
375382 # Invalid parameters.
376383 self .assertRaises (ValueError , graphs .NNGraph , features ,
0 commit comments