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

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

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

jhlegarreta
Copy link
Contributor

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

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
Copy link

codecov bot commented Jun 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

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

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

@jhlegarreta
Copy link
Contributor Author

doctest build failures are unrelated.

@effigies effigies merged commit 0da8c1c into nipy:master Jun 27, 2024
48 of 49 checks passed
@jhlegarreta jhlegarreta deleted the PreferVstack branch June 27, 2024 12:52
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