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

np.sort of memmap is still memmap #13846

Open
ZisIsNotZis opened this issue Jun 27, 2019 · 1 comment
Open

np.sort of memmap is still memmap #13846

ZisIsNotZis opened this issue Jun 27, 2019 · 1 comment

Comments

@ZisIsNotZis
Copy link

ZisIsNotZis commented Jun 27, 2019

I know this is not a big problem. Just mentioning here.

sort of a memmap (which uses different memory and is not a mmap anymore) is of type memmap.

I "kind of" remember one time that I got a readonly memmap with some non-inplace operaton, but this might not be true since I can't remember it clearly.

Reproducing code example:

import numpy as np
a = np.memmap('xxx.B', mode='r')
b = np.sort(a)
np.shares_memory(a, b), type(b), b.flags.writeable

Output:

(False, numpy.memmap, True)

Numpy/Python version information:

1.16.4 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0]

@seberg
Copy link
Member

seberg commented Jul 1, 2019

I remember having a year old patch that tries to change this a bit. Maybe worth a shot. The idea is really just to not do anything in __array_finalize__ and __array_wrap__. Now that 1.17 is branched off, might be a good time (since I suppose it might affect downstream, even if it should not).

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

No branches or pull requests

2 participants