-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Open
henrikmidtiby
wants to merge
12
commits into
ManimCommunity:main
Choose a base branch
from
henrikmidtiby:Typing_scene
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Typing scene #4191
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
94af075
Removed typing errors in mobject/geometry/shape_matchers.py
henrikmidtiby 9058b7e
Added type annotations fo mobject/types/image_mobject.py and a few ot…
henrikmidtiby 917ccd6
Adding type annotations to types/point_cloud_mobject.py
henrikmidtiby 9914218
Fixing issues revealed by type annotations in types/point_cloud_mobje…
henrikmidtiby 51ff361
Fix issue in the CI step related to the Camera class.
henrikmidtiby 702612d
Adding type annotations to geometry/line.py
henrikmidtiby 0e8b51d
Ignore type errors related to super and sub class in line.py and shap…
henrikmidtiby 11fa57e
Dealing with some issues and ignoring others identified by type checking
henrikmidtiby 7363913
Ignored a number of type issues related to float and floating[Any].
henrikmidtiby 68a4280
Help mypy to determine types.
henrikmidtiby f9d905f
More work on addressing typing issues.
henrikmidtiby 4628226
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 Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition Error loading related location Loadingimport Error loading related location Loading'Scene' may not be defined if module manim.scene.scene Error loading related location Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition Error loading related location Loadingimport Error loading related location Loading'Scene' may not be defined if module manim.scene.scene Error loading related location Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition Error loading related location Loadingimport Error loading related location Loading'Scene' may not be defined if module manim.scene.scene Error loading related location Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition Error loading related location Loadingimport Error loading related location Loading'Scene' may not be defined if module manim.scene.scene Error loading related location Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition Error loading related location Loadingimport Error loading related location Loading'Scene' may not be defined if module manim.scene.scene Error loading related location Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition Error loading related location Loadingimport Error loading related location Loading'Scene' may not be defined if module manim.scene.scene Error loading related location Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition Error loading related location Loadingimport Error loading related location Loading'Scene' may not be defined if module manim.scene.scene Error loading related location Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition Error loading related location Loadingimport Error loading related location Loading'Scene' may not be defined if module manim.scene.scene Error loading related location Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition Error loading related location Loadingimport Error loading related location Loading'Scene' may not be defined if module manim.scene.scene Error loading related location Loadingmanim.renderer.cairo_renderer Error loading related location Loadingdefinition 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