diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2023-05-13 11:02:49 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-13 11:02:49 -0600 |
commit | 5187067d7ad176ee3614beab2b99a524dd719aa8 (patch) | |
tree | 907997d0c294f550193322aaa73237c1a7bcfaa6 /numpy/lib/tests/test_arraypad.py | |
parent | b786189222ac5bf2f4efbb04399261f7f760bc18 (diff) | |
parent | 81caed6e3c34c4bf4b22b4f6167e816ba2a3f73c (diff) | |
download | numpy-5187067d7ad176ee3614beab2b99a524dd719aa8.tar.gz |
Merge branch 'main' into deprecate-find-common-type
Diffstat (limited to 'numpy/lib/tests/test_arraypad.py')
-rw-r--r-- | numpy/lib/tests/test_arraypad.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py index a59681573..0bebe3693 100644 --- a/numpy/lib/tests/test_arraypad.py +++ b/numpy/lib/tests/test_arraypad.py @@ -1139,6 +1139,23 @@ class TestWrap: a = np.arange(5) b = np.pad(a, (0, 12), mode="wrap") assert_array_equal(np.r_[a, a, a, a][:-3], b) + + def test_repeated_wrapping_multiple_origin(self): + """ + Assert that 'wrap' pads only with multiples of the original area if + the pad width is larger than the original array. + """ + a = np.arange(4).reshape(2, 2) + a = np.pad(a, [(1, 3), (3, 1)], mode='wrap') + b = np.array( + [[3, 2, 3, 2, 3, 2], + [1, 0, 1, 0, 1, 0], + [3, 2, 3, 2, 3, 2], + [1, 0, 1, 0, 1, 0], + [3, 2, 3, 2, 3, 2], + [1, 0, 1, 0, 1, 0]] + ) + assert_array_equal(a, b) class TestEdge: |