Skip to content

Commit

Permalink
Generator -> Iterable
Browse files Browse the repository at this point in the history
  • Loading branch information
chopan050 committed Dec 7, 2024
1 parent 5b5ae70 commit 9514d92
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions manim/mobject/types/vectorized_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import itertools as it
import sys
from collections.abc import Generator, Hashable, Iterable, Mapping, Sequence
from collections.abc import Hashable, Iterable, Mapping, Sequence
from typing import TYPE_CHECKING, Callable, Literal

import numpy as np
Expand Down Expand Up @@ -1302,7 +1302,7 @@ def _gen_subpaths_from_points(
self,
points: CubicBezierPath,
filter_func: Callable[[int], bool],
) -> Generator[CubicSpline]:
) -> Iterable[CubicSpline]:
"""Given an array of points defining the bezier curves of the vmobject, return subpaths formed by these points.
Here, Two bezier curves form a path if at least two of their anchors are evaluated True by the relation defined by filter_func.
Expand All @@ -1320,7 +1320,7 @@ def _gen_subpaths_from_points(
Returns
-------
Generator[CubicSpline]
Iterable[CubicSpline]
subpaths formed by the points.
"""
nppcc = self.n_points_per_cubic_curve
Expand All @@ -1342,7 +1342,7 @@ def get_subpaths_from_points(self, points: CubicBezierPath) -> list[CubicSpline]

def gen_subpaths_from_points_2d(
self, points: CubicBezierPath
) -> Generator[CubicSpline]:
) -> Iterable[CubicSpline]:
return self._gen_subpaths_from_points(
points,
lambda n: not self.consider_points_equals_2d(points[n - 1], points[n]),
Expand Down Expand Up @@ -1483,12 +1483,12 @@ def get_num_curves(self) -> int:

def get_curve_functions(
self,
) -> Generator[Callable[[float], Point3D]]:
) -> Iterable[Callable[[float], Point3D]]:
"""Gets the functions for the curves of the mobject.
Returns
-------
Generator[Callable[[float], Point3D]]
Iterable[Callable[[float], Point3D]]
The functions for the curves.
"""
num_curves = self.get_num_curves()
Expand All @@ -1498,7 +1498,7 @@ def get_curve_functions(

def get_curve_functions_with_lengths(
self, **kwargs
) -> Generator[tuple[Callable[[float], Point3D], float]]:
) -> Iterable[tuple[Callable[[float], Point3D], float]]:
"""Gets the functions and lengths of the curves for the mobject.
Parameters
Expand All @@ -1508,7 +1508,7 @@ def get_curve_functions_with_lengths(
Returns
-------
Generator[tuple[Callable[[float], Point3D], float]]
Iterable[tuple[Callable[[float], Point3D], float]]
The functions and lengths of the curves.
"""
num_curves = self.get_num_curves()
Expand Down

0 comments on commit 9514d92

Please sign in to comment.