-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Cannot get a view from a composite array with object data members #3253
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
FWIW, still the case on "1.7.2.dev-3b1a809". I have the use case where I want to have two datatypes: some base type 'dt' and another type 'dtSuper' which is a fixed-size array of 'dt' elements. I'd like to cast a properly-sized array with dtype dt to a (1,) array with dtype 'dtSuper', like so:
Object types, I imagine, could be dangerous if we're allowed to re-interpret them as arbitrary data types, as that gives us direct access to memory addresses and suddenly we're programming in C, with enough rope to hang ourselves with :-). I'm speculating that this is the underlying reason why we are now seeing this error in 1.7.1. However the use case I just described doesn't have this problem. It seems that it would make sense to special-case the code, or else (to be more general) somehow check to ensure that every object pointer in the old dtype maps to an object pointer in the new dtype. |
Still open in 1.9-devel. Note that is error occurs in |
So labelled "easy fix" until proved otherwise ;) |
Previously views of structured arrays containing objects were completely disabled. This commit adds more lenient check for whether an object-array view is allowed, and adds similar checks to getfield/setfield Fixes numpy#2346. Fixes numpy#3256. Fixes numpy#2599. Fixes numpy#3253. Fixes numpy#3286. Fixes numpy#5762.
Previously views of structured arrays containing objects were completely disabled. This commit adds more lenient check for whether an object-array view is allowed, and adds similar checks to getfield/setfield Fixes numpy#2346. Fixes numpy#3256. Fixes numpy#2599. Fixes numpy#3253. Fixes numpy#3286. Fixes numpy#5762.
Previously views of structured arrays containing objects were completely disabled. This commit adds more lenient check for whether an object-array view is allowed, and adds similar checks to getfield/setfield Fixes numpy#2346. Fixes numpy#3256. Fixes numpy#2599. Fixes numpy#3253. Fixes numpy#3286. Fixes numpy#5762.
Previously views of structured arrays containing objects were completely disabled. This commit adds more lenient check for whether an object-array view is allowed, and adds similar checks to getfield/setfield Fixes numpy#2346. Fixes numpy#3256. Fixes numpy#2599. Fixes numpy#3253. Fixes numpy#3286. Fixes numpy#5762.
Previously views of structured arrays containing objects were completely disabled. This commit adds more lenient check for whether an object-array view is allowed, and adds similar checks to getfield/setfield Fixes numpy#2346. Fixes numpy#3256. Fixes numpy#2599. Fixes numpy#3253. Fixes numpy#3286. Fixes numpy#5762.
Previously views of structured arrays containing objects were completely disabled. This commit adds more lenient check for whether an object-array view is allowed, and adds similar checks to getfield/setfield Fixes numpy#2346. Fixes numpy#3256. Fixes numpy#2599. Fixes numpy#3253. Fixes numpy#3286. Fixes numpy#5762.
Previously views of structured arrays containing objects were completely disabled. This commit adds more lenient check for whether an object-array view is allowed, and adds similar checks to getfield/setfield Fixes numpy#2346. Fixes numpy#3256. Fixes numpy#2599. Fixes numpy#3253. Fixes numpy#3286. Fixes numpy#5762.
Previously views of structured arrays containing objects were completely disabled. This commit adds more lenient check for whether an object-array view is allowed, and adds similar checks to getfield/setfield Fixes numpy#2346. Fixes numpy#3256. Fixes numpy#2599. Fixes numpy#3253. Fixes numpy#3286. Fixes numpy#5762.
Previously views of structured arrays containing objects were completely disabled. This commit adds more lenient check for whether an object-array view is allowed, and adds similar checks to getfield/setfield Fixes numpy#2346. Fixes numpy#3256. Fixes numpy#2599. Fixes numpy#3253. Fixes numpy#3286. Fixes numpy#5762.
With NumPy 1.7.1 on Win64 with Python 2.7 I see a new issue that was not a problem on a previous version (e.g., 1.6.2).
Consider a composite data type, where a view is obtained from:
cool (note: back in 1.4.1 although a subset could be made, the order was the same as the original).
However, if one of types used in the composite data type is '|O8', I can no longer obtain a view:
The text was updated successfully, but these errors were encountered: