ukoethe / vigra

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

Future incompatibility with numpy #474

Closed k-dominik closed 4 years ago

k-dominik commented 4 years ago

In https://github.com/ukoethe/vigra/issues/436 you noticed, that in future there will be a problem with numpy compatibility:

Can this warning (issued by numpy 1.15.2) explain the error?

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.

Originally posted by @ukoethe in https://github.com/ukoethe/vigra/issues/436#issuecomment-430752341

Now, this does also concern parts of vigra, which will have to be adapted. E.g. in https://github.com/ukoethe/vigra/blob/8acd73a5e0408326e2a3c1ed1c2c70ffe2b954d0/vigranumpy/lib/arraytypes.py#L1122 where slice is a list.

I have tried to figure out the timeline for this deprecation in numpy without success. Atm I am just a but annoyed by the warnings, which I no longer want to ignore. Are you @ukoethe still accepting contributions to vigra?

hmeine commented 4 years ago

Making slicing a tuple is a small and sensible change that I am sure @ukoethe will accept.