77
88def test_knn ():
99 knn = 10
10- xyz = np .random .rand (1000 , 3 )
10+ rng = np .random .default_rng ()
11+ xyz = rng .random (size = (1000 , 3 ))
1112 xyz = xyz .astype ("float32" )
1213 tree = KDTree (xyz )
1314 _ , k_legacy = tree .query (xyz , k = knn , workers = - 1 )
@@ -18,7 +19,8 @@ def test_knn():
1819def test_radius_search ():
1920 knn = 10
2021 radius = 0.2
21- xyz = np .random .rand (1000 , 3 )
22+ rng = np .random .default_rng ()
23+ xyz = rng .random (size = (1000 , 3 ))
2224 xyz = xyz .astype ("float32" )
2325 tree = KDTree (xyz )
2426 _ , k_legacy = tree .query (xyz , k = knn , distance_upper_bound = radius , workers = - 1 )
@@ -43,4 +45,4 @@ def test_pgeof_multiscale():
4345 simple = pgeof .compute_features (xyz , nn , nn_ptr , 50 , False )
4446 multi_simple = pgeof .compute_features_multiscale (xyz , nn , nn_ptr , [20 ], False )
4547 np .testing .assert_allclose (multi [:, 0 ], multi_simple [:, 0 ], 1e-1 , 1e-5 )
46- np .testing .assert_allclose (multi [:, 1 ], simple , 1e-1 , 1e-5 )
48+ np .testing .assert_allclose (multi [:, 1 ], simple , 1e-1 , 1e-5 )
0 commit comments