Repository: ManimCommunity/manim
File: manim/mobject/types/opengl_vectorized_mobject.py (Python)

Code before:
        self,
    ) -> typing.Iterable[typing.Tuple[typing.Callable[[float], np.ndarray], float]]:
        """Gets the functions and lengths of the curves for the mobject.

        Returns
        -------
        typing.Iterable[typing.Tuple[typing.Callable[[float], np.ndarray], float]]
            The functions and lengths of the curves.
        """

        num_curves = self.get_num_curves()

        for n in range(num_curves):
            yield self.get_nth_curve_function_with_length(n)

    def point_from_proportion(self, alpha: float) -> np.ndarray:
        """Gets the point at a proportion along the mobject.

        Parameters
        ----------
        alpha
            The proportion along the mobject.

        Returns
        -------
        np.ndarray
            The point on the mobject.

        Raises
        ------
        :exc:`ValueError`
            If ``alpha`` is not between 0 and 1.
        :exc:`Exception`
            If the mobject has no points.
        """

        if alpha < 0 or alpha > 1:
            raise ValueError(f"Alpha {alpha} not between 0 and 1.")

        self.throw_error_if_no_points()

        curves_with_lengths = list(self.get_curve_functions_with_lengths())

        total_length = np.sum(length for _, length in curves_with_lengths)
        target_length = alpha * total_length
        current_length = 0

        for curve, length in curves_with_lengths:
            if current_length + length >= target_length:
                if length != 0:
                    residue = (target_length - current_length) / length

Review comment (suggestion):
Is `np.ndarray` necessary here?
I am asking as it is also in the type hints.
But it rendered correctly:
![image](https://user-images.githubusercontent.com/44469195/114261373-7b91b900-99da-11eb-8bfc-58b59d188776.png)


Code after:

        for n in range(num_curves):
            yield self.get_nth_curve_function(n)

    def get_curve_functions_with_lengths(
        self, **kwargs
    ) -> typing.Iterable[typing.Tuple[typing.Callable[[float], np.ndarray], float]]:
        """Gets the functions and lengths of the curves for the mobject.

        Parameters
        ----------
        **kwargs
            The keyword arguments passed to :meth:`get_nth_curve_function_with_length`

        Returns
        -------
        typing.Iterable[typing.Tuple[typing.Callable[[float], np.ndarray], float]]
            The functions and lengths of the curves.
        """

        num_curves = self.get_num_curves()

        for n in range(num_curves):
            yield self.get_nth_curve_function_with_length(n, **kwargs)

    def point_from_proportion(self, alpha: float) -> np.ndarray:
        """Gets the point at a proportion along the path of the :class:`OpenGLVMobject`.

        Parameters
        ----------
        alpha
            The proportion along the the path of the :class:`OpenGLVMobject`.

        Returns
        -------
        :class:`numpy.ndarray`
            The point on the :class:`OpenGLVMobject`.

        Raises
        ------
        :exc:`ValueError`
            If ``alpha`` is not between 0 and 1.
        :exc:`Exception`
            If the :class:`OpenGLVMobject` has no points.
        """

        if alpha < 0 or alpha > 1:
            raise ValueError(f"Alpha {alpha} not between 0 and 1.")

        self.throw_error_if_no_points()
        if alpha == 1: