Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lang] Remove deprecated sparse_matrix_builder function #7942

Merged
merged 1 commit into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()