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

FIX: Use np.asarray instead of np.array(..., copy=False) #1304

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

effigies
Copy link
Member

@effigies effigies commented Mar 5, 2024

Numpy 2 is changing np.array(..., copy=False) to error if the array cannot be made without copying. The semantics we want are np.asarray(...), which will not make copies if the input is already an ndarray.

cc @larsoner

Copy link

codecov bot commented Mar 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.27%. Comparing base (e4facc1) to head (2bad8cc).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1304   +/-   ##
=======================================
  Coverage   92.27%   92.27%           
=======================================
  Files          99       99           
  Lines       12460    12460           
  Branches     2561     2561           
=======================================
  Hits        11497    11497           
  Misses        641      641           
  Partials      322      322           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@effigies effigies merged commit d1e89ac into nipy:master Mar 5, 2024
52 checks passed
@effigies effigies deleted the fix/array-copy branch March 5, 2024 14:28
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