Skip to content

Commit

Permalink
Deprecate Matrix.ss.diag and Vector.ss.diag (python-graphblas#342)
Browse files Browse the repository at this point in the history
These have been deprecated since 2022-04-04
  • Loading branch information
eriknw authored Dec 19, 2022
1 parent a9d0db1 commit 392596d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 34 deletions.
14 changes: 0 additions & 14 deletions graphblas/core/ss/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,6 @@ def orientation(self):
return "columnwise"
return "rowwise"

def diag(self, vector, k=0):
"""
GxB_Matrix_diag
**This function is deprecated. Use ``Vector.diag`` or ``Matrix.ss.build_diag`` instead.**
"""
warnings.warn(
"`Matrix.ss.diag` is deprecated; "
"please use `Vector.diag` or `Matrix.ss.build_diag` instead",
DeprecationWarning,
)
self.build_diag(vector, k)

def build_diag(self, vector, k=0):
"""
GxB_Matrix_diag
Expand Down
15 changes: 0 additions & 15 deletions graphblas/core/ss/vector.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import itertools
import warnings

import numpy as np
from numba import njit
Expand Down Expand Up @@ -147,20 +146,6 @@ def format(self):
raise NotImplementedError(f"Unknown sparsity status: {sparsity_status}")
return format

def diag(self, matrix, k=0):
"""
GxB_Vector_diag
**This function is deprecated. Use ``Matrix.diag`` or ``Vector.ss.build_diag`` instead.**
"""
warnings.warn(
"`Vector.ss.diag` is deprecated; "
"please use `Matrix.diag` or `Vector.ss.build_diag` instead",
DeprecationWarning,
)
self.build_diag(matrix, k)

def build_diag(self, matrix, k=0):
"""
GxB_Vector_diag
Expand Down
5 changes: 0 additions & 5 deletions graphblas/tests/test_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -3441,12 +3441,7 @@ def compare(A, expected, isequal=True, **kwargs):


def test_deprecated(A):
v = A.diag()
if suitesparse:
with pytest.warns(DeprecationWarning):
A.ss.diag(v)
with pytest.warns(DeprecationWarning):
v.ss.diag(A)
with pytest.warns(DeprecationWarning):
A.ss.compactify_rowwise()
with pytest.warns(DeprecationWarning):
Expand Down

0 comments on commit 392596d

Please sign in to comment.