Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update for NumPy 2.0 #244

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Update for NumPy 2.0 #244

merged 1 commit into from
Jul 2, 2024

Conversation

sgherbst
Copy link
Contributor

@sgherbst sgherbst commented Jul 2, 2024

This PR fixes an issue that came about with the recent release of NumPy 2.0. There were a few places where np.array() was used with copy=False, and that started causing exceptions because NumPy could not avoid making a copy.

To solve this, I simply removed copy=False. The performance impact should be low, because the copy=False option only came into play when writing NumPy integers (not arrays) as a UMI or AXI/AXI-Lite payload. Worst case, a few extra bytes will have to be copied for write() and atomic() operations, which should not be a bottleneck. In fact, it's possible that those bytes were already being copied and not throwing an exception under NumPy 1.0 behavior.

@sgherbst sgherbst marked this pull request as ready for review July 2, 2024 17:31
@sgherbst sgherbst merged commit 863d4f6 into main Jul 2, 2024
6 checks passed
@sgherbst sgherbst deleted the sgh/numpy2 branch July 2, 2024 17:31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant