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

DeprecationWarning in nrrd/writer.py with numpy 1.19.0 #110

Closed
fvdnabee opened this issue Jul 17, 2020 · 0 comments · Fixed by #112
Closed

DeprecationWarning in nrrd/writer.py with numpy 1.19.0 #110

fvdnabee opened this issue Jul 17, 2020 · 0 comments · Fixed by #112

Comments

@fvdnabee
Copy link

Since numpy 1.19.0 numpy.ndarray.tostring has been deprecated, as per the numpy documentation.

nrrd/writer.py currently issues a warning with the latest numpy version:

.../.env/lib/python3.8/site-packages/nrrd/writer.py:323: DeprecationWarning: tostring() is deprecated. Use tobytes() instead.
  raw_data = data.tostring(order=index_order

The fix would be to use numpy.ndarray.tobytes instead.

A quick fgrep shows that tostring is used on the following two locations:

❯ fgrep -r -nI tostring nrrd
nrrd/writer.py:294:        raw_data = data.tostring(order=index_order)
nrrd/writer.py:323:        raw_data = data.tostring(order=index_order)
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 a pull request may close this issue.

1 participant