-
Notifications
You must be signed in to change notification settings - Fork 89
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
test: fix on win32 #2117
test: fix on win32 #2117
Conversation
A = np.eye(2) * 2 | ||
B = np.eye(3) * 3 | ||
result = np.block( | ||
[ | ||
[ak.from_numpy(A), ak.from_numpy(np.zeros((2, 3)))], | ||
[ak.from_numpy(np.ones((3, 2))), ak.from_numpy(B)], | ||
] | ||
) | ||
assert isinstance(result, ak.Array) | ||
assert ak._util.arrays_approx_equal(result, np.partition(data, [4, 6])) | ||
assert ak._util.arrays_approx_equal( | ||
result, np.block([[A, np.zeros((2, 3))], [np.ones((3, 2)), B]]) | ||
) |
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 just wanted a test that involves a list argument. np.block
errors if one passes a tuple instead of a list, and it supports nested lists!
haystack = np.array([1, 2, 3, 4, 4, 5, 6, 7], dtype=np.int64) | ||
needle = np.array([5, 0, 2], dtype=np.int64) | ||
result = np.searchsorted(ak.from_numpy(haystack), ak.from_numpy(needle)) | ||
assert isinstance(result, ak.Array) | ||
assert ak._util.arrays_approx_equal(result, np.partition(data, np.array([4, 6]))) | ||
assert ak._util.arrays_approx_equal(result, np.searchsorted(haystack, needle)) |
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.
np.searchsorted
dodges the need to call np.partition
with non-scalar arguments
Codecov Report
Additional details and impacted files
|
Merging as I'm confident we want to start the release, and this is a test failure through NumPy usage. |
Thanks. I'm sorry that I was out of touch for a bit. (Daughter's violin practice.) |
No problem! It's "out of work hours" right now, I just made a judgement call. |
For some reason, this test was failing on Windows 32-bit. I suspect it relates to the integer check of int64 against ULONGLONG, but I can't find any detailed information. It's easier just to try a different test.