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
dtype "f64" silently results in "float32" #5790
Comments
I would consider this a bug, so no need to worry about backwards compat. First thought: an error makes sense here. |
The correct code for But the behavior does seem to be wrong, it seems to be checking the letter, and if the number doesn't make sense, it just returns the default type:
I agree with Ralf that raising an error makes all the sense in the world here. |
+1 to raising an error. If it's a simple change to make I could attach a commit here. |
The relevant code is here. It seems there has been a deprecation warning in place since 1.7:
Has the time come to turn this into an error in 1.10? I guess discussing on the list would be in order. Can you send a message to the mailing list, Christoph? |
Raising an error looks like the right thing. Because it has been deprecated, I don't think list discussion is needed. |
Looking at
it's not clear at all to me what needs to be done. Could someone else here please take care of this change (or discussion if needed)? Thanks! |
I'll look into it today or tomorrow. |
@jaimefrio - ping |
There's a tricky thing here, which has me swamped with test errors in trying to fix this... If you look at the code I linked above, one of the behaviors that is explicitly deprecated is using codes 'O4' or 'O8' for object arrays. Getting rid of the deprecation warning, including some special casing to handle pickling that should still accept, is not much of a problem. The issue is that, with current master:
That is, we have deprecated, and want to turn into an error, a dtype string descriptor... that is the one I see 3 ways to move forward on this:
Doing 1 is just punting on the object behavior, not my favorite. Doing 3 may be a little too aggressive, although it is the state we wish to one day arrive at, and what I am leaning towards right now. Doing 2 now, and turning trailing sizes on object dtypes into errors in the next release may be the aristotelian golden mean. Thoughts are welcome! |
FWIW: I'd split the solution into two, one implementing (1) and thus solving the present issue, the other going after the object dtypes (where I am not completely sure what the best solution would be; probably your (2) first, then (3), just to be sure, though maybe directly going to (3) is fine). |
Sounds to me like you've answered your question :-). No reason to delay the deprecation->changes for non-O dtypes. For O we
|
I've recently been bitten by this:
Some proposals what to change:
'f64'
input?'f64'
input?I know change is difficult for numpy because of backwards-compatibility concerns.
Hopefully it's possible to be more strict here ... in my code I was getting slightly incorrect results for half a year because I was using 32-bit floats where I know I needed to use 64-bit floats, but for some reason wrote "f64" instead of "float64".
The text was updated successfully, but these errors were encountered: