manim icon indicating copy to clipboard operation
manim copied to clipboard

ParametricFunction: wrong type hint

Open uwezi opened this issue 1 year ago • 1 comments

Description of bug / unexpected behavior

nothing really critical, but perhaps someone could just quickly change this

functions.py line 105

class ParametricFunction(VMobject, metaclass=ConvertToOpenGL):
    def __init__(
        self,
        function: Callable[[float], Point3D],
        t_range: Point2D | Point3D = (0, 1),
        scaling: _ScaleBase = LinearBase(),
        dt: float = 1e-8,
        discontinuities: Iterable[float] | None = None,
        use_smoothing: bool = True,
        use_vectorized: bool = False,
        **kwargs,
    ):

Giving a 2D/3D point as a type hint for the t_range just seems weird...

uwezi avatar Aug 26 '24 16:08 uwezi

I agree the name is misleading - however, it is technically correct as a numpy array of the right shape should also work. Despite that, I agree it's worth changing the typehint.

JasonGrace2282 avatar Sep 01 '24 14:09 JasonGrace2282