Improve performance of `TestSplineFilter1dLargeArray`
@@ -950,8 +950,13 @@ class TestSplineFilter1dLargeArray:
def test_spline_filter1d_large_array(self, xp, scp, mode):
if mode == 'grid-wrap' and scipy_version < '1.6.0':
pytest.skip('testing mode grid-wrap requires scipy >= 1.6.0')
- x = testing.shaped_random(
- (2**10, 2**10, 2**10), dtype=numpy.float64, xp=xp)
+ # Test input that cannot be indexed by int32 in bytes, i.e.
+ # x.size * dtype.itemsize >= 2 ** 31
+ x = xp.empty((2**20, 2**9), numpy.float64)
+ # To speed-up, do not generate many random numbers
+ x = x[::2**15, :]
+ x[...] = testing.shaped_random(
+ (2**5, 2**9), dtype=numpy.float64, xp=xp)
return scp.ndimage.spline_filter1d(x, mode=mode)
