cubed icon indicating copy to clipboard operation
cubed copied to clipboard

Consider using ndindex for canonicalizing indexes

Open tomwhite opened this issue 1 year ago • 0 comments

The logic in index for manipulating an index selection is fairly complicated, particularly the part that removes any ellipsis. (See #400, #401, #402.)

We could use ndindex to help with this - the following shows how easy it is to remove an ellipsis:

idx = ndindex.ndindex(key)
key = idx.expand(x.shape).raw

The library is well tested with Hypothesis tests, but it would be another (pure Python) dependency.

tomwhite avatar Feb 29 '24 10:02 tomwhite