summaryrefslogtreecommitdiff
path: root/numpy/lib/tests/test_function_base.py
diff options
context:
space:
mode:
authorMax Kellermeier <max.kellermeier@hotmail.de>2020-08-02 18:10:01 +0200
committerMax Kellermeier <max.kellermeier@hotmail.de>2020-08-02 18:10:01 +0200
commitdfee8851c65276907eedd084ff40334ea7d46865 (patch)
treea7c59f29c747369d599c86a8ff2f5ee9a2c34ee3 /numpy/lib/tests/test_function_base.py
parentf08059353890eff34c993d8bd5a8291f629f8fc7 (diff)
downloadnumpy-dfee8851c65276907eedd084ff40334ea7d46865.tar.gz
Tests added according to #14877, obsolete comments removed.
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r--numpy/lib/tests/test_function_base.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index eb2fc3311..878fb3de1 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1756,7 +1756,23 @@ class TestUnwrap:
assert_array_equal(unwrap([1, 1 + 2 * np.pi]), [1, 1])
# check that unwrap maintains continuity
assert_(np.all(diff(unwrap(rand(10) * 100)) < np.pi))
-
+
+ def test_minmax(self):
+ # check that unwrap removes jumps greater that 255
+ assert_array_equal(unwrap([1, 1 + 256], interval_size=255), [1, 2])
+ # check that unwrap maintains continuity
+ assert_(np.all(diff(unwrap(rand(10) * 1000, interval_size=255)) < 255))
+ # check simple case
+ simple_seq = np.array([0, 75, 150, 225, 300])
+ wrap_seq = np.mod(simple_seq, 255)
+ assert_array_equal(unwrap(wrap_seq, interval_size=255), simple_seq)
+ # check custom discont value
+ uneven_seq = np.array([0, 75, 150, 225, 300, 430])
+ wrap_uneven = np.mod(uneven_seq, 250)
+ no_discont = unwrap(wrap_uneven, interval_size=250)
+ assert_array_equal(no_discont, [0, 75, 150, 225, 300, 180])
+ sm_discont = unwrap(wrap_uneven, interval_size=250, discont=140)
+ assert_array_equal(sm_discont, [0, 75, 150, 225, 300, 430])
class TestFilterwindows: