Skip to content

Commit

Permalink
Address oversight in function renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
bwohlberg committed Dec 7, 2021
1 parent 891c909 commit dad8e0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scico/test/test_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,25 +182,25 @@ def f(x):

def test_split_join_array():
x, key = random.randn((4, 4), dtype=np.complex64)
x_s = solver.split_real_imag(x)
x_s = solver._split_real_imag(x)
assert x_s.shape == (2, 4, 4)
np.testing.assert_allclose(x_s[0], snp.real(x))
np.testing.assert_allclose(x_s[1], snp.imag(x))

x_j = solver.join_real_imag(x_s)
x_j = solver._join_real_imag(x_s)
np.testing.assert_allclose(x_j, x, rtol=1e-4)


def test_split_join_blockarray():
x, key = random.randn(((4, 4), (3,)), dtype=np.complex64)
x_s = solver.split_real_imag(x)
x_s = solver._split_real_imag(x)
assert x_s.shape == ((2, 4, 4), (2, 3))

real_block = BlockArray.array((x_s[0][0], x_s[1][0]))
imag_block = BlockArray.array((x_s[0][1], x_s[1][1]))
np.testing.assert_allclose(real_block.ravel(), snp.real(x).ravel(), rtol=1e-4)
np.testing.assert_allclose(imag_block.ravel(), snp.imag(x).ravel(), rtol=1e-4)

x_j = solver.join_real_imag(x_s)
x_j = solver._join_real_imag(x_s)
assert x_j.shape == x.shape
np.testing.assert_allclose(x_j.ravel(), x.ravel(), rtol=1e-4)

0 comments on commit dad8e0a

Please sign in to comment.