nipy / nibabel

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

RF: Prefer using `np.vstack` instead of `np.row_stack` #1330

Closed jhlegarreta closed 1 week ago

jhlegarreta commented 1 week ago

Prefer using np.vstack instead of np.row_stack.

Fixes:

nibabel/ecat.py: 3 warnings
  /home/runner/work/nibabel/nibabel/nibabel/ecat.py:393:
 DeprecationWarning: `row_stack` alias is deprecated. Use `np.vstack` directly.
    return np.row_stack(mlists)

and similar warnings.

Raised for example at: https://github.com/nipy/nibabel/actions/runs/9637811213/job/26577586721#step:7:186

Documentation: https://numpy.org/doc/1.26/reference/generated/numpy.row_stack.html

This helps preparing for full Numpy 2.0 compatibility. Documentation: https://numpy.org/doc/stable/numpy_2_0_migration_guide.html#main-namespace

codecov[bot] commented 1 week ago

Codecov Report

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

Project coverage is 92.20%. Comparing base (d18022d) to head (17809b0).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1330 +/- ## ======================================= Coverage 92.20% 92.20% ======================================= Files 98 98 Lines 12400 12400 Branches 2557 2557 ======================================= Hits 11433 11433 Misses 644 644 Partials 323 323 ```

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

jhlegarreta commented 1 week ago

doctest build failures are unrelated.