diff options
author | Tobias Pitters <tobias.pitters@gmail.com> | 2020-06-10 01:11:54 +0200 |
---|---|---|
committer | Tobias Pitters <tobias.pitters@gmail.com> | 2020-06-10 01:11:54 +0200 |
commit | e7603603e14288c9aedc0f6216f940c6658ee8e5 (patch) | |
tree | 8da4d895f8993043945f45d1b24b4d2c753c4627 /numpy/lib/tests/test_function_base.py | |
parent | 949bda505d226150bae0d7324ca675899c8396b9 (diff) | |
download | numpy-e7603603e14288c9aedc0f6216f940c6658ee8e5.tar.gz |
make lerp be able to handle 0d cases
Diffstat (limited to 'numpy/lib/tests/test_function_base.py')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 3c0c8ca89..763a0da78 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -3164,6 +3164,12 @@ class TestLerp: # double subtraction is needed to remove the extra precision that t < 0.5 has assert np.lib.function_base._lerp(a, b, 1 - (1 - t)) == np.lib.function_base._lerp(b, a, 1 - t) + def test_lerp_0d_inputs(self): + a = np.array(2) + b = np.array(5) + t = np.array(0.2) + assert np.lib.function_base._lerp(a, b, t) == 2.6 + class TestMedian: |