Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
Nov 14, 2019

Conversation

eric-wieser
Copy link
Member

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.

highm1_arr = <np.ndarray>np.empty_like(high_arr, dtype=np.{{nptype}})
highm1_arr = <np.ndarray>np.empty_like(high_arr, dtype=np.{{otype}})
Copy link
Member Author

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.

@eric-wieser eric-wieser force-pushed the remove-uses-of-scalar-aliases branch from 6638c81 to b7181a3 Compare November 13, 2019 17:59
@eric-wieser eric-wieser requested a review from mattip November 13, 2019 18:02
@@ -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)
Copy link
Member

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?

Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@mattip
Copy link
Member

mattip commented Nov 13, 2019

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.

@eric-wieser eric-wieser force-pushed the remove-uses-of-scalar-aliases branch from b7181a3 to 6dfe331 Compare November 13, 2019 21:46
@eric-wieser
Copy link
Member Author

A few of these tests really are testing the behavior of builtins. I fixed the two you called out.

@mattip mattip merged commit d1d9dd5 into numpy:master Nov 14, 2019
@mattip
Copy link
Member

mattip commented Nov 14, 2019

Thanks @eric-wieser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants