From 5636b41dfd6ce2b838f1ebfac57e731808e1919e Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Thu, 25 Feb 2021 08:48:41 -0800 Subject: [PATCH] bug fix for resize_with_interpolation in the case of length=0 --- manimlib/utils/iterables.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manimlib/utils/iterables.py b/manimlib/utils/iterables.py index e7d8fc6a..4fd0582c 100644 --- a/manimlib/utils/iterables.py +++ b/manimlib/utils/iterables.py @@ -98,6 +98,8 @@ def resize_preserving_order(nparray, length): def resize_with_interpolation(nparray, length): if len(nparray) == length: return nparray + if length == 0: + return np.zeros((0, *nparray.shape[1:])) cont_indices = np.linspace(0, len(nparray) - 1, length) return np.array([ (1 - a) * nparray[lh] + a * nparray[rh]