Skip to content

Commit

Permalink
Add type annotations to manim/camera/multi_camera.py - part 3
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmidtiby committed Jan 21, 2025
1 parent b1a3508 commit f767e8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manim/camera/multi_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def update_sub_cameras(self) -> None:
"""Reshape sub_camera pixel_arrays"""
for imfc in self.image_mobjects_from_cameras:
pixel_height, pixel_width = self.pixel_array.shape[:2]
imfc.camera.frame_shape = (
# TODO:
# error: "MovingCamera" has no attribute "frame_shape" [attr-defined]
imfc.camera.frame_shape = ( # type: ignore[attr-defined]
imfc.camera.frame.height,
imfc.camera.frame.width,
)
Expand Down
1 change: 1 addition & 0 deletions manim/mobject/types/image_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from manim.mobject.geometry.shape_matchers import SurroundingRectangle

from ... import config
from ...camera.moving_camera import MovingCamera

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'MovingCamera' may not be defined if module
manim.camera.moving_camera
is imported before module
manim.mobject.types.image_mobject
, as the
definition
of MovingCamera occurs after the cyclic
import
of manim.mobject.types.image_mobject.
'MovingCamera' may not be defined if module
manim.camera.moving_camera
is imported before module
manim.mobject.types.image_mobject
, as the
definition
of MovingCamera occurs after the cyclic
import
of manim.mobject.types.image_mobject.
'MovingCamera' may not be defined if module
manim.camera.moving_camera
is imported before module
manim.mobject.types.image_mobject
, as the
definition
of MovingCamera occurs after the cyclic
import
of manim.mobject.types.image_mobject.
from ...constants import *
from ...mobject.mobject import Mobject
from ...utils.bezier import interpolate
Expand Down
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ ignore_errors = True
[mypy-manim.camera.camera.*]
ignore_errors = False

[mypy-manim.camera.multi_camera.*]
ignore_errors = False

[mypy-manim.cli.*]
ignore_errors = False

Expand Down

0 comments on commit f767e8a

Please sign in to comment.