Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Bugfix: Fix some type hints (ints to floats) (#1154)

Aron196045b471ac
diff --git a/manim/animation/animation.py b/manim/animation/animation.py
index 8b6c43e07..001832199 100644
--- a/manim/animation/animation.py
+++ b/manim/animation/animation.py
@@ -34,7 +34,7 @@ class Animation:
# If 0 < lag_ratio < 1, its applied to each
# with lagged start times
lag_ratio: float = DEFAULT_ANIMATION_LAG_RATIO,
- run_time: int = DEFAULT_ANIMATION_RUN_TIME,
+ run_time: float = DEFAULT_ANIMATION_RUN_TIME,
rate_func: typing.Callable[[float, float], np.ndarray] = smooth,
name: str = None,
remover: bool = False, # remove a mobject from the screen?
@@ -117,7 +117,7 @@ class Animation:
*[mob.family_members_with_points() for mob in self.get_all_mobjects()]
)
- def update_mobjects(self, dt: int) -> None:
+ def update_mobjects(self, dt: float) -> None:
"""
Updates things like starting_mobject, and (for
Transforms) target_mobject. Note, since typically
@@ -259,7 +259,7 @@ class Wait(Animation):
def clean_up_from_scene(self, scene: "Scene") -> None:
pass
- def update_mobjects(self, dt: int) -> None:
+ def update_mobjects(self, dt: float) -> None:
pass
def interpolate(self, alpha: float) -> None:
diff --git a/manim/animation/composition.py b/manim/animation/composition.py
index 9bb4eaf89..1cffe3149 100644
--- a/manim/animation/composition.py
+++ b/manim/animation/composition.py
@@ -59,7 +59,7 @@ class AnimationGroup(Animation):
for anim in self.animations:
anim.clean_up_from_scene(scene)
- def update_mobjects(self, dt: int) -> None:
+ def update_mobjects(self, dt: float) -> None:
for anim in self.animations:
anim.update_mobjects(dt)
@@ -115,7 +115,7 @@ class Succession(AnimationGroup):
while self.active_animation is not None:
self.next_animation()
- def update_mobjects(self, dt: int) -> None:
+ def update_mobjects(self, dt: float) -> None:
if self.active_animation:
self.active_animation.update_mobjects(dt)
diff --git a/manim/animation/indication.py b/manim/animation/indication.py
index 1434a1b07..253e722cf 100644
--- a/manim/animation/indication.py
+++ b/manim/animation/indication.py
@@ -105,7 +105,7 @@ class Flash(AnimationGroup):
flash_radius: float = 0.3,
line_stroke_width: int = 3,
color: str = YELLOW,
- run_time: int = 1,
+ run_time: float = 1.0,
**kwargs
) -> None:
self.point = point
diff --git a/manim/mobject/svg/text_mobject.py b/manim/mobject/svg/text_mobject.py
index eb3a43c89..e96d94535 100644
--- a/manim/mobject/svg/text_mobject.py
+++ b/manim/mobject/svg/text_mobject.py
@@ -693,7 +693,7 @@ class Text(SVGMobject):
def __init__(
self,
text: str,
- fill_opacity: int = 1,
+ fill_opacity: float = 1.0,
stroke_width: int = 0,
color: str = WHITE,
size: int = 1,