MCPcopy Index your code
hub / github.com/numpy/numpy / sorted_block

Method sorted_block

benchmarks/benchmarks/bench_function_base.py:213–224  ·  view source on GitHub ↗

Returns an array with blocks that are all sorted.

(size, dtype, block_size, rnd)

Source from the content-addressed store, hash-verified

211 @staticmethod
212 @memoize
213 def sorted_block(size, dtype, block_size, rnd):
214 """
215 Returns an array with blocks that are all sorted.
216 """
217 a = SortGenerator.ordered_range(size, dtype=dtype)
218 b = []
219 if size < block_size:
220 return a
221 block_num = size // block_size
222 for i in range(block_num):
223 b.extend(a[i::block_num])
224 return np.array(b)
225
226
227class Sort(Benchmark):

Callers

nothing calls this directly

Calls 1

ordered_rangeMethod · 0.80

Tested by

no test coverage detected