Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions manim/animation/animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __new__(
if func is not None:
anim = func(mobject, *args, **kwargs)
logger.debug(
f"The {cls.__name__} animation has been is overridden for "
f"The {cls.__name__} animation has been overridden for "
f"{type(mobject).__name__} mobjects. use_override = False can "
f" be used as keyword argument to prevent animation overriding.",
)
Expand All @@ -140,7 +140,7 @@ def __init__(
introducer: bool = False,
*,
_on_finish: Callable[[], None] = lambda _: None,
**kwargs,
use_override: bool = True, # included here to avoid TypeError if passed from a subclass' constructor
) -> None:
self._typecheck_input(mobject)
self.run_time: float = run_time
Expand All @@ -160,8 +160,6 @@ def __init__(
else:
self.starting_mobject: Mobject = Mobject()
self.mobject: Mobject = mobject if mobject is not None else Mobject()
if kwargs:
logger.debug("Animation received extra kwargs: %s", kwargs)

if hasattr(self, "CONFIG"):
logger.error(
Expand Down Expand Up @@ -498,6 +496,8 @@ def __init_subclass__(cls, **kwargs) -> None:

cls._original__init__ = cls.__init__

_original__init__ = __init__ # needed if set_default() is called with no kwargs directly from Animation

@classmethod
def set_default(cls, **kwargs) -> None:
"""Sets the default values of keyword arguments.
Expand Down
10 changes: 3 additions & 7 deletions manim/animation/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(
):
pointwise = getattr(mobject, "pointwise_become_partial", None)
if not callable(pointwise):
raise NotImplementedError("This animation is not defined for this Mobject.")
raise TypeError(f"{self.__class__.__name__} only works for VMobjects.")
super().__init__(mobject, **kwargs)

def interpolate_submobject(
Expand All @@ -133,7 +133,7 @@ def interpolate_submobject(
starting_submobject, *self._get_bounds(alpha)
)

def _get_bounds(self, alpha: float) -> None:
def _get_bounds(self, alpha: float) -> tuple[float, float]:
raise NotImplementedError("Please use Create or ShowPassingFlash")


Expand Down Expand Up @@ -173,7 +173,7 @@ def __init__(
) -> None:
super().__init__(mobject, lag_ratio=lag_ratio, introducer=introducer, **kwargs)

def _get_bounds(self, alpha: float) -> tuple[int, float]:
def _get_bounds(self, alpha: float) -> tuple[float, float]:
return (0, alpha)


Expand Down Expand Up @@ -229,8 +229,6 @@ def __init__(
rate_func: Callable[[float], float] = double_smooth,
stroke_width: float = 2,
stroke_color: str = None,
draw_border_animation_config: dict = {}, # what does this dict accept?
fill_animation_config: dict = {},
introducer: bool = True,
**kwargs,
) -> None:
Expand All @@ -244,8 +242,6 @@ def __init__(
)
self.stroke_width = stroke_width
self.stroke_color = stroke_color
self.draw_border_animation_config = draw_border_animation_config
self.fill_animation_config = fill_animation_config
self.outline = self.get_outline()

def _typecheck_input(self, vmobject: VMobject | OpenGLVMobject) -> None:
Expand Down
2 changes: 1 addition & 1 deletion manim/animation/indication.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def __init__(self, mobject: VMobject, time_width: float = 0.1, **kwargs) -> None
self.time_width = time_width
super().__init__(mobject, remover=True, introducer=True, **kwargs)

def _get_bounds(self, alpha: float) -> tuple[float]:
def _get_bounds(self, alpha: float) -> tuple[float, float]:
tw = self.time_width
upper = interpolate(0, 1 + tw, alpha)
lower = upper - tw
Expand Down
1 change: 0 additions & 1 deletion manim/animation/transform_matching_parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def __init__(
# target_map
transform_source = group_type()
transform_target = group_type()
kwargs["final_alpha_value"] = 0
for key in set(source_map).intersection(target_map):
transform_source.add(source_map[key])
transform_target.add(target_map[key])
Expand Down
2 changes: 1 addition & 1 deletion manim/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ def update_label(mobject):
label.add_updater(update_label)
self.add(dot, label)

self.play(Rotating(dot, about_point=ORIGIN, angle=TAU, run_time=TAU, rate_func=linear))
self.play(Rotating(dot, about_point=ORIGIN, run_time=TAU, rate_func=linear))

.. manim:: DtUpdater

Expand Down