Skip to content

Commit

Permalink
[FIX] assert statements
Browse files Browse the repository at this point in the history
  • Loading branch information
f-dangel committed May 22, 2024
1 parent cebd8c0 commit 8b776df
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/test_submatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_SubmatrixLinearOperator__matvec(
x = random.rand(A_sub.shape[1])
A_sub_linop_x = A_sub_linop @ x

assert (len(col_idxs),) if adjoint else A_sub_linop_x.shape == (len(row_idxs),)
assert A_sub_linop_x.shape == ((len(col_idxs),) if adjoint else (len(row_idxs),))
report_nonclose(A_sub @ x, A_sub_linop_x)


Expand Down Expand Up @@ -85,10 +85,8 @@ def test_SubmatrixLinearOperator__matmat(
X = random.rand(A_sub.shape[1], num_vecs)
A_sub_linop_X = A_sub_linop @ X

assert (
(len(col_idxs), num_vecs)
if adjoint
else A_sub_linop_X.shape == (len(row_idxs), num_vecs)
assert A_sub_linop_X.shape == (
(len(col_idxs), num_vecs) if adjoint else (len(row_idxs), num_vecs)
)
report_nonclose(A_sub @ X, A_sub_linop_X)

Expand Down

0 comments on commit 8b776df

Please sign in to comment.