nipy / nibabel

Python package to access a cacophony of neuro-imaging file formats
http://nipy.org/nibabel/
Other
634 stars 258 forks source link

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

Closed effigies closed 4 months ago

effigies commented 4 months ago

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

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.