-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Typing scene #4191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Typing scene #4191
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b5fc0be
Removed typing errors in mobject/geometry/shape_matchers.py
henrikmidtiby 344baff
Added type annotations fo mobject/types/image_mobject.py and a few ot…
henrikmidtiby 4a40c3e
Adding type annotations to types/point_cloud_mobject.py
henrikmidtiby f115cb0
Fixing issues revealed by type annotations in types/point_cloud_mobje…
henrikmidtiby 4d20019
Fix issue in the CI step related to the Camera class.
henrikmidtiby 628fe89
Adding type annotations to geometry/line.py
henrikmidtiby 7714681
Ignore type errors related to super and sub class in line.py and shap…
henrikmidtiby 18e593f
Dealing with some issues and ignoring others identified by type checking
henrikmidtiby 7fbb397
Ignored a number of type issues related to float and floating[Any].
henrikmidtiby 9341fb5
Help mypy to determine types.
henrikmidtiby 37bd106
More work on addressing typing issues.
henrikmidtiby 020bbe5
Reverting two changes that triggers an error in the automatic testing.
henrikmidtiby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
from typing import Any | ||
|
||
from manim.animation.animation import Animation | ||
from manim.scene.scene import Scene | ||
Check failureCode scanning / CodeQL Module-level cyclic import Error
'Scene' may not be defined if module
manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading import Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading import Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading import Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading import Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading import Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading import Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading import Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading import Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading import Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading 'Scene' may not be defined if module manim.scene.scene Error loading related location Loading manim.renderer.cairo_renderer Error loading related location Loading definition Error loading related location Loading |
||
|
||
from ..typing import PixelArray | ||
|
||
|
@@ -33,11 +33,11 @@ | |
|
||
def __init__( | ||
self, | ||
file_writer_class=SceneFileWriter, | ||
camera_class=None, | ||
skip_animations=False, | ||
**kwargs, | ||
): | ||
file_writer_class: type[SceneFileWriter] = SceneFileWriter, | ||
camera_class: Camera | None = None, | ||
skip_animations: bool = False, | ||
**kwargs: Any, | ||
) -> None: | ||
# All of the following are set to EITHER the value passed via kwargs, | ||
# OR the value stored in the global config dict at the time of | ||
# _instance construction_. | ||
|
@@ -51,7 +51,7 @@ | |
self.time = 0 | ||
self.static_image = None | ||
|
||
def init_scene(self, scene): | ||
def init_scene(self, scene: Scene) -> None: | ||
self.file_writer: Any = self._file_writer_class( | ||
self, | ||
scene.__class__.__name__, | ||
|
@@ -119,12 +119,12 @@ | |
|
||
def update_frame( # TODO Description in Docstring | ||
self, | ||
scene, | ||
scene: Scene, | ||
mobjects: typing.Iterable[Mobject] | None = None, | ||
include_submobjects: bool = True, | ||
ignore_skipping: bool = True, | ||
**kwargs, | ||
): | ||
**kwargs: Any, | ||
) -> None: | ||
"""Update the frame. | ||
|
||
Parameters | ||
|
@@ -263,7 +263,7 @@ | |
self.skip_animations = True | ||
raise EndSceneEarlyException() | ||
|
||
def scene_finished(self, scene): | ||
def scene_finished(self, scene: Scene) -> None: | ||
# If no animations in scene, render an image instead | ||
if self.num_plays: | ||
self.file_writer.finish() | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check failure
Code scanning / CodeQL
Module-level cyclic import Error