Back to index

python-biopython  1.60
test_KDTree.py
Go to the documentation of this file.
00001 # This code is part of the Biopython distribution and governed by its
00002 # license.  Please see the LICENSE file that should have been included
00003 # as part of this package.
00004 
00005 try:
00006     import numpy
00007 except ImportError:
00008     from Bio import MissingExternalDependencyError
00009     raise MissingExternalDependencyError(\
00010         "Install NumPy if you want to use Bio.KDTree.")
00011 
00012 try:
00013     from Bio.KDTree import _CKDTree
00014 except ImportError:
00015     from Bio import MissingExternalDependencyError
00016     raise MissingExternalDependencyError(\
00017         "C module in Bio.KDTree not compiled")
00018 
00019 from Bio.KDTree.KDTree import _neighbor_test, _test
00020 
00021 nr_points=5000
00022 dim=3
00023 bucket_size=5
00024 radius=0.01
00025 
00026 for i in range(0, 10):
00027     _neighbor_test(nr_points, dim, bucket_size, radius)
00028     _test(nr_points, dim, bucket_size, radius)