Skip to content

Commit

Permalink
[Lang] Remove deprecated sparse_matrix_builder function
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-hitonami committed May 6, 2023
1 parent 0599ecc commit 6809c08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
15 changes: 2 additions & 13 deletions python/taichi/linalg/sparse_matrix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import warnings
from functools import reduce

import numpy as np
Expand All @@ -7,7 +6,7 @@
from taichi.lang.exception import TaichiRuntimeError
from taichi.lang.field import Field
from taichi.lang.impl import get_runtime
from taichi.types import annotations, f32
from taichi.types import f32


class SparseMatrix:
Expand Down Expand Up @@ -294,14 +293,4 @@ def build(self, dtype=f32, _format="CSR"):
raise TaichiRuntimeError("Sparse matrix only supports CPU and CUDA backends.")


# TODO: remove this in 1.0 release
class sparse_matrix_builder(annotations.sparse_matrix_builder):
def __init__(self):
warnings.warn(
"ti.linalg.sparse_matrix_builder is deprecated, and it will be removed in Taichi v1.6.0. "
"Please use ti.types.sparse_matrix_builder instead.",
DeprecationWarning,
)


__all__ = ["SparseMatrix", "SparseMatrixBuilder", "sparse_matrix_builder"]
__all__ = ["SparseMatrix", "SparseMatrixBuilder"]
9 changes: 0 additions & 9 deletions tests/python/test_deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,3 @@ def test_deprecation_in_taichi_init_py():
match="ti.SOA is deprecated, and it will be removed in Taichi v1.6.0.",
):
ti.SOA


@test_utils.test()
def test_deprecate_sparse_matrix_builder():
with pytest.warns(
DeprecationWarning,
match=r"ti\.linalg\.sparse_matrix_builder is deprecated, and it will be removed in Taichi v1\.6\.0\.",
):
ti.linalg.sparse_matrix_builder()

0 comments on commit 6809c08

Please sign in to comment.