Did I find the right examples for you? yes no      Crawl my project      Python Jobs

# Bio.KDTree._CKDTree.KDTree.set_data

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)

```    kdt = _CKDTree.KDTree(dim, bucket_size)
coords = random((nr_points, dim))
kdt.set_data(coords)
r = [neighbor.radius for neighbor in neighbors]
```
```    coords = random((nr_points, dim))
center = coords[0]
kdt.set_data(coords)
r = kdt.get_indices()
```

```    kdt = _CKDTree.KDTree(dim, bucket_size)
coords = random((nr_points, dim))
kdt.set_data(coords)
r = [neighbor.radius for neighbor in neighbors]
```
```    coords = random((nr_points, dim))
center = coords[0]
kdt.set_data(coords)
r = kdt.get_indices()
```

```        if unitcell is None:
self._kdtree = CKDTree(3, self._bucketsize)
self._kdtree.set_data(coords)
else:
if not isinstance(unitcell, ndarray):
raise TypeError('unitcell must be a Numpy array')
if unitcell.shape != (3,):
raise ValueError('unitcell.shape must be (3,)')
self._kdtree = CKDTree(3, self._bucketsize)
self._kdtree.set_data(coords)
```
```                                          for rep in self._replicate])
kdtree = CKDTree(3, self._bucketsize)
kdtree.set_data(coords)
self._kdtree2 = kdtree
n_atoms = len(self._coords)
```

```        if unitcell is None:
self._kdtree = CKDTree(3, self._bucketsize)
self._kdtree.set_data(coords)
else:
if not isinstance(unitcell, ndarray):
raise TypeError('unitcell must be a Numpy array')
if unitcell.shape != (3,):
raise ValueError('unitcell.shape must be (3,)')
self._kdtree = CKDTree(3, self._bucketsize)
self._kdtree.set_data(coords)
```
```                                          for rep in self._replicate])
kdtree = CKDTree(3, self._bucketsize)
kdtree.set_data(coords)
self._kdtree2 = kdtree
n_atoms = len(self._coords)
```