Fix: shift_slice to accept single slices as argument, and return tuples
Two fixes to pystencils.slicing.shift_slice:
- Previously,
shift_sliceassumed its argumentslicesto be iterable. Thus, it did not accept single slices as arguments. There are use cases, though, where it is necessary to shift a plainsliceobject, or evenintorfloatobjects which can also be seen as slices. An additionalisinstancecheck takes care of this. - Previously,
shift_slicereturnedlists of slices. By default, Python wraps multidimensional slices astuples. Code for manipulating multidimensional slices thus expects them to be given as tuples. Also, although it is currently possible to access numpy arrays with lists of slices instead of tuples, this action produces a deprecation warning. Thus,shift_sliceis changed to return tuples.
An additional test case evaluating array accesses with shifted slices is also added.