From 4d90ee5792b302e153d02b24021f341ca8238c57 Mon Sep 17 00:00:00 2001 From: Geoo Chi Date: Sun, 29 Sep 2024 14:03:19 +0800 Subject: [PATCH] Fix np.float_ to np.float64 while using numpy >= 2.0 --- manim/utils/iterables.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manim/utils/iterables.py b/manim/utils/iterables.py index cf6f664f98..678750deb2 100644 --- a/manim/utils/iterables.py +++ b/manim/utils/iterables.py @@ -33,7 +33,7 @@ T = TypeVar("T") U = TypeVar("U") -F = TypeVar("F", np.float_, np.int_) +F = TypeVar("F", np.float64, np.int_) H = TypeVar("H", bound=Hashable) @@ -311,8 +311,8 @@ def resize_array(nparray: npt.NDArray[F], length: int) -> npt.NDArray[F]: def resize_preserving_order( - nparray: npt.NDArray[np.float_], length: int -) -> npt.NDArray[np.float_]: + nparray: npt.NDArray[np.float64], length: int +) -> npt.NDArray[np.float64]: """Extends/truncates nparray so that ``len(result) == length``. The elements of nparray are duplicated to achieve the desired length (favours earlier elements).