Skip to content
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

Merged
merged 1 commit into from
Jan 13, 2023
Merged

test: fix on win32 #2117

merged 1 commit into from
Jan 13, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Jan 13, 2023

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.

Comment on lines +17 to +28
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]])
)
Copy link
Collaborator Author

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!

Comment on lines +32 to +36
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))
Copy link
Collaborator Author

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
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Merging #2117 (d60a7a7) into main (54ab9f3) will increase coverage by 0.05%.
The diff coverage is n/a.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/_util.py 73.75% <0.00%> (-8.32%) ⬇️
src/awkward/record.py 82.51% <0.00%> (-0.22%) ⬇️
src/awkward/types/__init__.py 100.00% <0.00%> (ø)
src/awkward/operations/ak_sort.py 60.00% <0.00%> (ø)
src/awkward/operations/ak_argsort.py 75.00% <0.00%> (ø)
src/awkward/types/scalartype.py 77.27% <0.00%> (ø)
src/awkward/_typetracer.py 61.57% <0.00%> (+0.54%) ⬆️
src/awkward/highlevel.py 76.86% <0.00%> (+0.64%) ⬆️
src/awkward/_prettyprint.py 70.96% <0.00%> (+0.68%) ⬆️
src/awkward/operations/ak_to_layout.py 89.13% <0.00%> (+0.75%) ⬆️
... and 2 more

@agoose77 agoose77 temporarily deployed to docs-preview January 13, 2023 00:58 — with GitHub Actions Inactive
@agoose77
Copy link
Collaborator Author

Merging as I'm confident we want to start the release, and this is a test failure through NumPy usage.

@agoose77 agoose77 merged commit 17b2529 into main Jan 13, 2023
@agoose77 agoose77 deleted the agoose77/fix-test-win-32 branch January 13, 2023 01:09
@jpivarski
Copy link
Member

Thanks. I'm sorry that I was out of touch for a bit. (Daughter's violin practice.)

@agoose77
Copy link
Collaborator Author

No problem! It's "out of work hours" right now, I just made a judgement call.

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

Successfully merging this pull request may close these issues.

2 participants