@@ -182,24 +182,16 @@ def test_set_coordinates(self):
182
182
def test_nngraph (self ):
183
183
Xin = np .arange (90 ).reshape (30 , 3 )
184
184
dist_types = ['euclidean' , 'manhattan' , 'max_dist' , 'minkowski' ]
185
- backends = ['scipy-kdtree' , 'scipy-pdist' , 'flann' ]
186
- order = 3 # for minkowski
185
+ backends = ['scipy-kdtree' , 'scipy-pdist' , 'flann' ]
186
+ order = 3 # for minkowski, FLANN only accepts integer orders
187
187
188
188
for cur_backend in backends :
189
189
for dist_type in dist_types :
190
- print ("backend={} dist={}" .format (cur_backend , dist_type ))
191
- if dist_type != 'minkowski' :
192
- # curently radius only implemented with scipy kdtree
193
- if cur_backend == 'scipy-kdtree' :
194
- graphs .NNGraph (Xin , NNtype = 'radius' ,
195
- backend = cur_backend ,
196
- dist_type = dist_type )
197
- graphs .NNGraph (Xin , NNtype = 'knn' ,
198
- backend = cur_backend ,
199
- dist_type = dist_type )
190
+ if cur_backend == 'flann' and dist_type == 'max_dist' :
191
+ self .assertRaises (ValueError , graphs .NNGraph , Xin ,
192
+ NNtype = 'knn' , backend = cur_backend ,
193
+ dist_type = dist_type )
200
194
else :
201
- # Only p-norms with 1<=p<=infinity permitted.
202
- # flann only accepts integer orders
203
195
if cur_backend == 'scipy-kdtree' :
204
196
graphs .NNGraph (Xin , NNtype = 'radius' ,
205
197
backend = cur_backend ,
@@ -208,7 +200,6 @@ def test_nngraph(self):
208
200
backend = cur_backend ,
209
201
dist_type = dist_type , order = order )
210
202
211
-
212
203
def test_bunny (self ):
213
204
graphs .Bunny ()
214
205
0 commit comments