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

New array copy semantics #1517

Merged
merged 2 commits into from Mar 15, 2024
Merged

New array copy semantics #1517

merged 2 commits into from Mar 15, 2024

Conversation

mstimberg
Copy link
Member

In numpy 1.x, array(x, copy=False) meant : do not copy if possible. In numpy 2.0, it will raise an error if copying is not possible. This commit replaces the use of array(x, copy=False) by asarray(x), which has the "do not copy if possible" in both numpy 1.x and numpy 2.0.

In numpy 1.x, `array(x, copy=False)` meant : do not copy if possible.
In numpy 2.0, it will raise an error if copying is not possible. This
commit replaces the use of `array(x, copy=False)` by `asarray(x)`, which
has the "do not copy if possible" in both numpy 1.x and numpy 2.0.
@mstimberg
Copy link
Member Author

The changes in this PR should hopefully make tests pass against numpy 2.0: https://github.com/brian-team/brian2/actions/runs/8294727053

@mstimberg mstimberg merged commit 93feaa3 into master Mar 15, 2024
81 checks passed
@mstimberg mstimberg deleted the new_array_copy_semantics branch March 15, 2024 15:04
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.

None yet

1 participant