In all of SF's usage of np.concatenate, the following pattern is used
array = np.empty((rows, columns), dtype=dtype)
np.concatenate(blocks_norm, axis=1, out=array)
array.flags.writeable = False
As np.concatenate does not support generators, and has additional overhead for more general cases, an optimized version might be implemented in ArrayKit.
NumPy's PyArray_AssignArray seems to be pretty close to what is needed:
https://github.com/numpy/numpy/blob/891ab8ee00755a539bd118b1bbe4e0a237a2d844/numpy/core/src/multiarray/array_assign_array.c#L295
But given that the destination is guaranteed to be a newly created, contiguous array, there might be a more efficient route.
We might be able to use this lower level interface directly:
https://github.com/numpy/numpy/blob/891ab8ee00755a539bd118b1bbe4e0a237a2d844/numpy/core/src/multiarray/array_assign_array.c#L80
In all of SF's usage of np.concatenate, the following pattern is used
As
np.concatenatedoes not support generators, and has additional overhead for more general cases, an optimized version might be implemented in ArrayKit.NumPy's
PyArray_AssignArrayseems to be pretty close to what is needed:https://github.com/numpy/numpy/blob/891ab8ee00755a539bd118b1bbe4e0a237a2d844/numpy/core/src/multiarray/array_assign_array.c#L295
But given that the destination is guaranteed to be a newly created, contiguous array, there might be a more efficient route.
We might be able to use this lower level interface directly:
https://github.com/numpy/numpy/blob/891ab8ee00755a539bd118b1bbe4e0a237a2d844/numpy/core/src/multiarray/array_assign_array.c#L80