Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
Sort the cell index of the particles and
modify the sorted index array accordingly.
Parameters
----------
cell_idx : 1darray of integers
The cell index of the particle
sorted_idx : 1darray of integers
Represents the original index of the
particle before the sorting.
"""
Ntot = cell_idx.shape[0]
if Ntot > 0:
sorter = sorting.RadixSort(Ntot, dtype = np.int32)
sorter.sort(cell_idx, vals = sorted_idx)