diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2020-08-31 11:14:40 +0100 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2020-08-31 11:14:40 +0100 |
commit | 36ad0e43127240377692b9ca669db06c7fb153f7 (patch) | |
tree | 12df18665829d4330565d42c7394062d5c92f2d8 /numpy/lib/tests | |
parent | bbe2cca1925873dea538674b96b53b5cef0a148a (diff) | |
download | numpy-36ad0e43127240377692b9ca669db06c7fb153f7.tar.gz |
ENH: Make the window functions exactly symmetric
This relies on the fact that `cos` is exactly symmetric around zero, but not around the floating-point approximation of `pi`.
Closes gh-17169.
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 41afccacc..7bddb941c 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -1805,28 +1805,28 @@ class TestFilterwindows: def test_hanning(self): # check symmetry w = hanning(10) - assert_array_almost_equal(w, flipud(w), 7) + assert_equal(w, flipud(w)) # check known value assert_almost_equal(np.sum(w, axis=0), 4.500, 4) def test_hamming(self): # check symmetry w = hamming(10) - assert_array_almost_equal(w, flipud(w), 7) + assert_equal(w, flipud(w)) # check known value assert_almost_equal(np.sum(w, axis=0), 4.9400, 4) def test_bartlett(self): # check symmetry w = bartlett(10) - assert_array_almost_equal(w, flipud(w), 7) + assert_equal(w, flipud(w)) # check known value assert_almost_equal(np.sum(w, axis=0), 4.4444, 4) def test_blackman(self): # check symmetry w = blackman(10) - assert_array_almost_equal(w, flipud(w), 7) + assert_equal(w, flipud(w)) # check known value assert_almost_equal(np.sum(w, axis=0), 3.7800, 4) |