pydata / sparse

Sparse multi-dimensional arrays for the PyData ecosystem

Home Page:https://sparse.pydata.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dok Slicing gives wrong output.

H4R5H1T-007 opened this issue · comments

Describe the Bug
Dok Slicing gives wrong output for slice indices = (slice(1, None, -1), slice(None, None, 1))

To Reproduce

import numpy as np
import sparse
s_array = sparse.random((1,3), density=1/3, format='dok')
d_array = s_array.todense()
indices = (slice(1, None, -1), slice(None, None, 1))
print((s_array[indices].todense() == d_array[indices]).all())
# False

Expected behavior
It should print True.

System

  • OS and version: Pop Os 20.04
  • sparse version (0.12)
  • NumPy version (1.20.2)
  • Numba version (0.53.1)

This was fixed by #501.