ukoethe / vigra

a generic C++ library for image analysis
http://ukoethe.github.io/vigra/
Other
407 stars 191 forks source link

use tuples for numpy indexing #475

Closed k-dominik closed 4 years ago

k-dominik commented 4 years ago

Hi @ukoethe,

maybe it's the social isolation but warnings in ilastik started bothering me a lot. Some of them go back to vigra and could be fixed with the patch of this PR. While the changes here are not critical right now (I couldn't find a timeline about this deprecation) it cannot hurt to be prepared.

numpy currently warns with the following warning when not using tuples for indexing:

vigranumpy/vigra/arraytypes.py:1263: FutureWarning: Using a non-tuple sequence
for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`.
In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will
result either in an error or a different result.

fixed by simply converting the index to a tuple in relevant places.

fixes #474

hmeine commented 4 years ago

I merged the change. The CI "failure" were just cancelled builds on macOS. Windows + Linux worked, and the code changes were minimal and looked good.

k-dominik commented 4 years ago

thx a lot @hmeine!