-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Failure to load .npy file with structured dtype and metadata #14142
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
Loads just fine on 1.15.4 + 64-bit windows, looks like a regression. Also loads fine on 1.16.0.dev0+d14632c |
1.17.x and 1.16.2 I am seeing a |
No issues on 1.18.0.dev0+84e8412 + python 3.5 either. Perhaps only the release has the problem, or perhaps it's a 3.7 issue |
Oh, hmmm, maybe then it is a python version related thing, interesting. I was testing with 3.7:
resulting in no error set returns. |
On 3.5 and 84e8412, that gives |
Oh, interesting, on python 2.7, I get a simple invalid datatype error, on 3.7 I get "no error set", I had not tested the pickle, I can reproduce the error on python 3.7 both with 16.2 and master. |
My hunch is the cause is this line: numpy/numpy/core/src/multiarray/descriptor.c Line 501 in edf8a5f
which calls I have no idea why that print is there |
Yep, that fixed it |
…o an exception being in flight We shouldn't be reporting errors via print anyway Related to numpygh-14142
Ah, nice, thanks. Guess I can close this then. |
Don't think we can close this, the problem I solved is the one you discovered, not the one this issue reports |
Ohh, sorry. Somewhat thought those were the same, heh... |
…o an exception being in flight We shouldn't be reporting errors via print anyway Related to numpygh-14142
…o an exception being in flight We shouldn't be reporting errors via print anyway Related to numpygh-14142
Pushing off to 1.17.2 |
Well, heck. Pushed it off again. |
Will push this one of (as discussed also in the triage meeting), but I am not sure how important this issue is still/now, so please ping to bump it if necessary. |
@tacaswell Is this still a problem? |
Yes, but now with an extra warning:
|
Hmmmm, I somehow thought I once wrote stripping logic, so that it would drop but load. I guess some half-finished PR somewhere. |
Yeah, #23371 should cause all metdata to be dropped, so it isn't clear to me why it cannot be loaded. It would seem that there must be some whole in the logic. |
Haha, the change was fine... The problem is that the code just failed to actually use the cleaned up version... |
We had logic in place to drop (most) metadata, but the change had a small bug: During saving, we were still using the one with metadata... Maybe doesn't quite close it, but big enough of an improvement for now, I think, so Closes numpygh-14142
We had logic in place to drop (most) metadata, but the change had a small bug: During saving, we were still using the one with metadata... Maybe doesn't quite close it, but big enough of an improvement for now, I think, so Closes numpygh-14142
We had logic in place to drop (most) metadata, but the change had a small bug: During saving, we were still using the one with metadata... Maybe doesn't quite close it, but big enough of an improvement for now, I think, so Closes numpygh-14142
We had logic in place to drop (most) metadata, but the change had a small bug: During saving, we were still using the one with metadata... Maybe doesn't quite close it, but big enough of an improvement for now, I think, so Closes numpygh-14142
The dtype description in an NPY file can be written in a way that prevents the file from being read. The attached array in bad_array.pkl.zip exhibits this problem. In this case the written dtype is
[('id', '|V16'), ('has_fit', '|b1'), ('timeax', ('|O', {'vlen': dtype('float64')})), ('', '|V8'), ('profile', ('|O', {'vlen': dtype('float64')})), ('', '|V8'), ('area', '<f8')]
.(Note that it was obtained from via h5py - if this is an issue with the format of the arrays produced by that library, I'm happy to file a bug there instead.)
Reproducing code example:
Error message:
Numpy/Python version information:
1.17.0 3.7.2 (default, Jul 14 2019, 10:22:38)
[Clang 9.0.0 (clang-900.0.39.2)]
The text was updated successfully, but these errors were encountered: