Skip to content

Commit

Permalink
Use named function for ParametricFunction.function
Browse files Browse the repository at this point in the history
  • Loading branch information
chopan050 committed Dec 6, 2024
1 parent 9f684db commit 6ca5daf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion manim/mobject/graphing/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ def __init__(
use_vectorized: bool = False,
**kwargs,
):
self.function: Callable[[float], Point3D] = lambda t: np.asarray(function(t))
def internal_parametric_function(t: float) -> Point3D:
"""Wrap ``function``'s output inside a NumPy array."""
return np.asarray(function(t))

self.function = internal_parametric_function

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class Warning

Assignment overwrites attribute function, which was previously defined in subclass
FunctionGraph
.
if len(t_range) == 2:
t_range = (*t_range, 0.01)

Expand Down

0 comments on commit 6ca5daf

Please sign in to comment.