SF's NPYConvert.to_py has to do the following. This can probably be done more efficiently with the C API such that no intermediate arrays (each chunck) need to be created.
if fortran_order and not flags.c_contiguous:
for chunk in np.nditer(
array,
flags=cls.NDITER_FLAGS,
buffersize=buffersize,
order='F',
):
file.write(chunk.tobytes('C'))
else:
for chunk in np.nditer(
array,
flags=cls.NDITER_FLAGS,
buffersize=buffersize,
order='C',
):
file.write(chunk.tobytes('C'))
SF's
NPYConvert.to_py
has to do the following. This can probably be done more efficiently with the C API such that no intermediate arrays (eachchunck
) need to be created.