Skip to content

Commit e6d0670

Browse files
committed
address comments
1 parent bedbee0 commit e6d0670

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

scipy/fft/tests/test_real_transforms.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,10 @@ def test_orthogonalize_noop(func, type, norm, xp):
197197
cpu_only=True)
198198
@pytest.mark.parametrize("norm", ["backward", "ortho", "forward"])
199199
def test_orthogonalize_dct1(norm, xp):
200-
x = xp.asarray(np.random.rand(100))
200+
x_np = np.random.rand(100)
201+
x = xp.asarray(x_np)
201202

202-
# use array-api-compat namespace for dask
203-
# since dask asarray never makes a copy
204-
# which makes xp_copy silently a no-op
205-
xp = array_namespace(x)
206-
x2 = xp_copy(x, xp=xp)
203+
x2 = xp.asarray(x_np.copy())
207204
x2[0] *= SQRT_2
208205
x2[-1] *= SQRT_2
209206

@@ -235,12 +232,9 @@ def test_orthogonalize_dcst2(func, norm, xp):
235232
@pytest.mark.parametrize("norm", ["backward", "ortho", "forward"])
236233
@pytest.mark.parametrize("func", [dct, dst])
237234
def test_orthogonalize_dcst3(func, norm, xp):
238-
x = xp.asarray(np.random.rand(100))
239-
# use array-api-compat namespace for dask
240-
# since dask asarray never makes a copy
241-
# which makes xp_copy silently a no-op
242-
xp = array_namespace(x)
243-
x2 = xp_copy(x, xp=xp)
235+
x_np = np.random.rand(100)
236+
x = xp.asarray(x_np)
237+
x2 = xp.asarray(x_np.copy())
244238
x2[0 if func == dct else -1] *= SQRT_2
245239

246240
y1 = func(x, type=3, norm=norm, orthogonalize=True)

0 commit comments

Comments
 (0)