Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffered byte writing to an open file #61

Open
flexatone opened this issue Nov 19, 2021 · 0 comments · May be fixed by #62
Open

Buffered byte writing to an open file #61

flexatone opened this issue Nov 19, 2021 · 0 comments · May be fixed by #62
Assignees

Comments

@flexatone
Copy link
Contributor

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'))
@flexatone flexatone linked a pull request Nov 21, 2021 that will close this issue
@flexatone flexatone self-assigned this Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant