Skip to content

Commit 85e6e69

Browse files
authored
Merge pull request #814 from pydata/enable-coo-tests
MAINT: Re-enable COO tests after fix
2 parents 3393a42 + e4e4687 commit 85e6e69

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

sparse/mlir_backend/_conversions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ def _from_scipy(arr: ScipySparseArray, copy: bool | None = None) -> Array:
103103
data = arr.data
104104
if copy:
105105
data = data.copy()
106-
row = row.copy()
107-
col = col.copy()
106+
107+
# TODO: Make them own the data until https://github.com/llvm/llvm-project/issues/116012 is fixed.
108+
row = row.copy()
109+
col = col.copy()
108110

109111
level_props = LevelProperties(0)
110112
if not arr.has_canonical_format:

sparse/mlir_backend/tests/test_simple.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ def test_csf_format(dtype):
289289

290290

291291
@parametrize_dtypes
292-
@pytest.mark.skip(reason="https://github.com/llvm/llvm-project/issues/116012")
293292
def test_coo_3d_format(dtype):
294293
format = sparse.levels.get_storage_format(
295294
levels=(
@@ -501,22 +500,8 @@ def test_reshape_dense(dtype):
501500
np.testing.assert_equal(actual_np, expected)
502501

503502

504-
@pytest.mark.parametrize(
505-
"src_fmt",
506-
[
507-
"csr",
508-
"csc",
509-
pytest.param("coo", marks=pytest.mark.skip(reason="https://github.com/llvm/llvm-project/issues/116012")),
510-
],
511-
)
512-
@pytest.mark.parametrize(
513-
"dst_fmt",
514-
[
515-
"csr",
516-
"csc",
517-
pytest.param("coo", marks=pytest.mark.skip(reason="https://github.com/llvm/llvm-project/issues/116012")),
518-
],
519-
)
503+
@pytest.mark.parametrize("src_fmt", ["csr", "csc", "coo"])
504+
@pytest.mark.parametrize("dst_fmt", ["csr", "csc", "coo"])
520505
def test_asformat(rng, src_fmt, dst_fmt):
521506
SHAPE = (100, 50)
522507
DENSITY = 0.5
@@ -529,7 +514,8 @@ def test_asformat(rng, src_fmt, dst_fmt):
529514

530515
expected = sps_arr.asformat(dst_fmt)
531516

532-
actual_fmt = sparse.asarray(expected, copy=False).format
517+
copy = None if dst_fmt == "coo" else False
518+
actual_fmt = sparse.asarray(expected, copy=copy).format
533519
actual = sp_arr.asformat(actual_fmt)
534520
actual_sps = sparse.to_scipy(actual)
535521

0 commit comments

Comments
 (0)