Skip to content

DOC, TST: avoid refcount semantics in using numpy.memmap #17754

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

Merged
merged 3 commits into from
Nov 11, 2020

Conversation

mattip
Copy link
Member

@mattip mattip commented Nov 11, 2020

These test were very slow on PyPy and flaky on windows because they relied on refcount semantics to close the underlying mmap object when calling __del__. This PR refactors them to use flush instead, which is sufficient to prove the point of the tests. Also

  • update documentation to prefer flush to __del__, and point out the shortfalls of __del__
  • use a pytest fixture to get a temporary directory rather than a local solution.

@mattip
Copy link
Member Author

mattip commented Nov 11, 2020

xref MacPython/numpy-wheels#103

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@seberg
Copy link
Member

seberg commented Nov 11, 2020

Thanks Matti.

@seberg seberg merged commit 74b3e15 into numpy:master Nov 11, 2020
@mattip mattip deleted the norefcount branch April 8, 2021 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants