-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
MAINT: Remove uses of scalar aliases #14901
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
MAINT: Remove uses of scalar aliases #14901
Conversation
highm1_arr = <np.ndarray>np.empty_like(high_arr, dtype=np.{{nptype}}) | ||
highm1_arr = <np.ndarray>np.empty_like(high_arr, dtype=np.{{otype}}) |
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.
A note: nptype is such that npy_{nptype}
is valid in C, otype is such that np.{otype}
is valid in python.
6638c81
to
b7181a3
Compare
numpy/core/tests/test_ufunc.py
Outdated
@@ -980,7 +980,7 @@ def test_can_ignore_signature(self): | |||
assert_array_equal(out, mm_row_col_vec.squeeze()) | |||
|
|||
def test_matrix_multiply(self): | |||
self.compare_matrix_multiply_results(np.long) | |||
self.compare_matrix_multiply_results(np.compat.long) |
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.
maybe a more specific dtype would be better than using a builtin?
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.
How about I make a follow-up that uses parametrize for this test?
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.
ok
LGTM. The test failure for b7181a3 is the win32 heisenbug. There are a few places where the use of a builtin for test parametrization next to specific dtypes looks out of place. Maybe they could all be specific dtypes rather than a mix of specific and builtins, but other than that this is a nice cleanup. |
b7181a3
to
6dfe331
Compare
A few of these tests really are testing the behavior of builtins. I fixed the two you called out. |
Thanks @eric-wieser |
Relates to gh-6103
Proof that this is exhaustive as of writing can be found in the CI of gh-14882, hopefully.
Even if it's not exhaustive, it's still good to merge something that gets us closer.
Split from gh-14882 so that cleanup can go in quickly, assuming a long discussion about deprecation.