Skip to content

Commit

Permalink
Merge pull request #8084 from chainer-ci/bp-8059-v13-fix-medfilt-erro…
Browse files Browse the repository at this point in the history
…rtype

[backport] Fix `scp.signal.{medfilt,medfilt2d}` to raise ValueError for complex64 inputs
  • Loading branch information
kmaehashi authored Jan 28, 2024
2 parents 6ba9395 9329927 commit e34e2a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 337,15 @@ def test_firls_freqz(self, xp, scp):
@testing.numpy_cupy_allclose(scipy_name='scp')
def test_compare(self, xp, scp):
# compare to OCTAVE output
taps = scp.signal.firls(9, [0, 0.5, 0.55, 1], [1, 1, 0, 0], [1, 2])
taps = scp.signal.firls(
9, [0, 0.5, 0.55, 1], [1, 1, 0, 0], weight=[1, 2])
return taps

@testing.numpy_cupy_allclose(scipy_name='scp')
def test_compare_2(self, xp, scp):
# compare to MATLAB output
taps = scp.signal.firls(11, [0, 0.5, 0.5, 1], [1, 1, 0, 0], [1, 2])
taps = scp.signal.firls(
11, [0, 0.5, 0.5, 1], [1, 1, 0, 0], weight=[1, 2])
return taps

@testing.numpy_cupy_allclose(scipy_name='scp')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 369,7 @@ def test_medfilt_no_complex(self, xp, scp, dtype):
kernel_size = kernel_size[:volume.ndim]
return scp.signal.medfilt(volume, kernel_size)

@testing.with_requires('scipy>=1.11.0')
@testing.with_requires('scipy>=1.11.0', 'scipy<1.12.0rc1')
@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(
atol=1e-8, rtol=1e-8, scipy_name='scp',
Expand Down Expand Up @@ -400,7 400,7 @@ def test_medfilt2d_no_complex(self, xp, scp, dtype):
kernel_size = self.kernel_size
return scp.signal.medfilt2d(input, kernel_size)

@testing.with_requires('scipy>=1.11.0')
@testing.with_requires('scipy>=1.11.0', 'scipy<1.12.0rc1')
@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(
atol=1e-8, rtol=1e-8, scipy_name='scp',
Expand Down

0 comments on commit e34e2a0

Please sign in to comment.