-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
regression (from 1.5.x) with return of operations on memmap'ed arrays (Trac #2215) #667
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
Comments
@yarikoptic Could you add some specific examples of what you want to see? |
oh boy -- I do not remember details NOW. is there a backup of those issues in their entirety somewhere to refresh what caused me to file the issue? (urls now get redirected here to github) |
If there were any attachments, they would be here along with any comments. But I agree that this is ancient, about 1000 years in computer seconds ;) If you can't jog your memory, I'll close this because I don't know what it is talking about. Not that I've got much experience with memmapped files in the first place. |
I can't access the original ticket, but in NumPy 1.8.2, This discrepancy seems to fit with numpy-gitbot's original message for this issue. |
Hmm; that's overstating my involvement: this came from investigating someone else's Stack Overflow question. See here: http://stackoverflow.com/q/25369982/270986 |
The sum method is implemented with |
Your suspicions seem to be accurate 😀.
|
Hmm, by and large, the operations try to preserve subclasses, and memmap inherits from ndarray. The best fix for this might be in numpy.memmap, defined in |
For instance,
If people are going to subclass ndarray and scalar types, we might want to modify |
That would be a bit larger modification though. 0-d arrays (array scalars) are currently not considered scalars by isscalar. To me the subclass thing seems like broadening it is good though. |
is it possible to use |
…1659) Cast np.memmap into np.array when calling `center_of_mass()`. Upstream issue numpy/numpy#667 is fixed but we bundle an old numpy version.
…1659) Cast np.memmap into np.array when calling `center_of_mass()`. Upstream issue numpy/numpy#667 is fixed but we bundle an old numpy version. Former-commit-id: 75a7408
Original ticket http://projects.scipy.org/numpy/ticket/2215 on 2012-09-14 by @yarikoptic, assigned to unknown.
As
http://projects.scipy.org/numpy/ticket/2179
stated: "Ideally one should be returning other ndarray objects, e.g. numpy scalars in the case of sum(), but this requires a larger rewrite. At least numpy version 1.5.1rc1 did this. The only time the _mmap should be kept (as I am aware of) is when slicing. "
This issue remains not fixed thus opening a separate issue for the above. Taking into account that np.asscalar() called on scalars
(e.g. which would be returned by np.sum on ndarrays) crashes, it becomes impossible to write code agnostic of ndarray/memmap container types.
it is also not clear why array-wide operations on mode='c' memmap'ed arrays which cannot really get reflected in the file storage, remain memmapped and do not result in normal ndarrays, but I guess that would be a separate issue...
The text was updated successfully, but these errors were encountered: