riptide_cpp icon indicating copy to clipboard operation
riptide_cpp copied to clipboard

some functions don't handle strided inputs correctly

Open jack-pappas opened this issue 5 years ago • 1 comments

A user reported that fetching elements from an array using a fancy index was returning incorrect results; after digging into it a bit, I found they had a 2D array which they were slicing out a column from, and that column is what they were using the fancy index to extract elements from.

It looks like the fancy-indexing function mbget does not handle (or even check for) an array with non-default striding, and instead silently treats the array as if it does have default striding, so the results are incorrect.

There are a number of functions in riptide_cpp which suffer from the same problem -- at minimum, the Python entry points for these functions should check whether the array has non-default striding and raise a NotImplementedError; this would prevent the correctness issues and allow users to diagnose and solve the problem on their own by making a compacted copy of the array as a workaround until the function is able to be fixed to handle non-default striding.

jack-pappas avatar Dec 17 '20 20:12 jack-pappas

This was fixed for mbget (the fancy-indexing function in riptide_cpp) in 2d5846ed.

There are still other functions where this needs to be fixed, so I'll leave this ticket open as a reminder.

jack-pappas avatar Feb 04 '21 13:02 jack-pappas