Skip to content

Commit aa0cd4f

Browse files
authored
Add type hints to scene_file_writer.py, section.py, and zoomed_scene.py (#4133)
* Add type hints to scene/scene_file_write.py * Add type hints to scene/scene_file_write.py * Add type hints to scene/section.py * Add type hints to scene/zoomed_scene.py * Add type hints to scene/moving_camera_scene.py * Fix typing of variable scene_name * Fix typing * Fix one more type hint
1 parent a9b65ee commit aa0cd4f

File tree

7 files changed

+137
-136
lines changed

7 files changed

+137
-136
lines changed

manim/camera/moving_camera.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(
3636
default_frame_stroke_color=WHITE,
3737
default_frame_stroke_width=0,
3838
**kwargs,
39-
):
39+
) -> None:
4040
"""Frame is a Mobject, (should almost certainly be a rectangle)
4141
determining which region of space the camera displays
4242
"""

manim/scene/moving_camera_scene.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,12 @@ def create_scene(number):
8989

9090
__all__ = ["MovingCameraScene"]
9191

92-
from typing_extensions import Any
92+
from typing import Any
9393

9494
from manim.animation.animation import Animation
9595
from manim.mobject.mobject import Mobject
9696

97+
from ..camera.camera import Camera
9798
from ..camera.moving_camera import MovingCamera
9899
from ..scene.scene import Scene
99100
from ..utils.family import extract_mobject_family_members
@@ -115,7 +116,7 @@ class MovingCameraScene(Scene):
115116
"""
116117

117118
def __init__(
118-
self, camera_class: type[MovingCamera] = MovingCamera, **kwargs: Any
119+
self, camera_class: type[Camera] = MovingCamera, **kwargs: Any
119120
) -> None:
120121
super().__init__(camera_class=camera_class, **kwargs)
121122

@@ -131,7 +132,7 @@ def get_moving_mobjects(self, *animations: Animation) -> list[Mobject]:
131132
"""
132133
moving_mobjects = super().get_moving_mobjects(*animations)
133134
all_moving_mobjects = extract_mobject_family_members(moving_mobjects)
134-
movement_indicators = self.renderer.camera.get_mobjects_indicating_movement()
135+
movement_indicators = self.renderer.camera.get_mobjects_indicating_movement() # type: ignore[union-attr]
135136
for movement_indicator in movement_indicators:
136137
if movement_indicator in all_moving_mobjects:
137138
# When one of these is moving, the camera should

0 commit comments

Comments
 (0)