Commit da63ca66 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

BUG: make sure all inputs have type i4

parent 7f1c7ed2
Pipeline #5295 failed with stage
in 6 minutes and 53 seconds
......@@ -149,8 +149,12 @@ class RadialBasis(BasisFunc):
:return: tuple with the request and centroid indices in compressed format
"""
if self._precomputed_grids is not None:
list_of_lists = np.zeros(req.npos, dtype='object')
list_of_lists[()] = [[]]
if not hasattr(self, '_ref_list_of_lists'):
self._ref_list_of_lists = np.zeros(req.npos, dtype='object')
empty_arr = np.zeros(0, dtype='i4')
for idx in range(req.npos):
self._ref_list_of_lists[idx] = empty_arr
list_of_lists = self._ref_list_of_lists.copy()
max_size, affine, intersects = self._precomputed_grids
if (req.radius() > max_size).any():
raise ValueError("Precomputed results only deal with maximum request radius of {}, ".format(max_size) +
......@@ -160,6 +164,7 @@ class RadialBasis(BasisFunc):
list_of_lists[use] = intersects[tuple(voxels[use].T)]
list_of_lists = list(list_of_lists)
idx_centroid = sp.concatenate(list_of_lists)
assert idx_centroid.dtype == 'i4'
else:
tree2 = spatial.cKDTree(req.center())
size1 = sp.asarray(self.size)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment