diff options
author | Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> | 2020-02-19 11:46:14 -0800 |
---|---|---|
committer | Raghuveer Devulapalli <raghuveer.devulapalli@intel.com> | 2020-02-23 07:37:52 -0800 |
commit | 0164256c4b3d3143c369e29530f4ece027d049b3 (patch) | |
tree | 92e8f6b197387bb138d1024170f7d354c11fa423 /numpy/core/tests | |
parent | 9b1acd42e8d4cfd476dc97b8d5bfe12b0c229d9d (diff) | |
download | numpy-0164256c4b3d3143c369e29530f4ece027d049b3.tar.gz |
TST: Adding test to validate np.maximum.accumulate and np.minimum.accumulate
Diffstat (limited to 'numpy/core/tests')
-rw-r--r-- | numpy/core/tests/test_umath.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py index d1d4467d6..233a0b1d6 100644 --- a/numpy/core/tests/test_umath.py +++ b/numpy/core/tests/test_umath.py @@ -3157,6 +3157,14 @@ def test_rint_big_int(): # Rint should not change the value assert_equal(val, np.rint(val)) +@pytest.mark.parametrize('ftype', [np.float32, np.float64]) +def test_memoverlap_accumulate(ftype): + # Reproduces bug https://github.com/numpy/numpy/issues/15597 + arr = np.array([0.61, 0.60, 0.77, 0.41, 0.19], dtype=ftype) + out_max = np.array([0.61, 0.61, 0.77, 0.77, 0.77], dtype=ftype) + out_min = np.array([0.61, 0.60, 0.60, 0.41, 0.19], dtype=ftype) + assert_equal(np.maximum.accumulate(arr), out_max) + assert_equal(np.minimum.accumulate(arr), out_min) def test_signaling_nan_exceptions(): with assert_no_warnings(): |