-
Notifications
You must be signed in to change notification settings - Fork 80
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
Distinguish between np type hints from Py ones #4953
Distinguish between np type hints from Py ones #4953
Conversation
return type(x) == {p_type} | ||
""" | ||
exec(func_str, globals()) | ||
t = empty_table(1).update(["X = i", f"Y = f((float)X)"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it is only testing the np.float32
case or is casting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests are just to make sure that the converted args' types are what we expected, the exact types of the values are not a concern here and they are tested in other test cases in the same test class.
return type(x) == {p_type} | ||
""" | ||
exec(func_str, globals()) | ||
t = empty_table(1).update(["X = i", f"Y = f(({p_type})X)"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this should also be testing with long
and double
since the python types are wide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the comment above.
return type(x) == {p_type} | ||
""" | ||
exec(func_str, globals()) | ||
t = empty_table(1).update(["X = i", f"Y = f(X)"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it is only testing the np.int32
case or is doing casting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the behavior here is correct. X
is an np.int32
. Here np.int8
is an accepted input in one iteration, which would be a downconversion -- certainly bad and should fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't yet statically check if the parameter types and argument types match. That's something for the improvement of the QLP. Runtime exception however will be thrown if the arg value is outside the range of a numpy integer type.
Fixes #4933