Skip to content

Commit

Permalink
Some aggressive changes to silence a significant number of type errors.
Browse files Browse the repository at this point in the history
Error count: 90 -> 66
  • Loading branch information
henrikmidtiby committed Oct 28, 2024
1 parent 1165469 commit 4c14674
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions manim/scene/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def __init__(
# TODO: We should probably change the default value to the empty list.
# This would remove several type issues, but it also triggers a lot of
# errors in the unittests (pytest)
self.animations: list[Animation] | None = None
self.animations: list[Animation] = []
self.stop_condition: Callable[[], bool] | None = None
self.moving_mobjects: list[Mobject] = []
self.static_mobjects: list[Mobject] = []
Expand All @@ -128,7 +128,7 @@ def __init__(
# TODO: We should probably change the default value to 0, to avoid
# handling the case where the value is None.
# This change triggers no errors in the unittests (pytest).
self.last_t: float | None = None
self.last_t: float = 0
self.queue: Queue = Queue()
self.skip_animation_preview = False
self.meshes: list[Object3D] = []
Expand Down
4 changes: 2 additions & 2 deletions manim/scene/scene_file_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def open_partial_movie_stream(self, file_path: str | None = None) -> None:
partial_movie_file_pix_fmt = "argb"

with av.open(file_path, mode="w") as video_container:
stream = video_container.add_stream(
stream: Any = video_container.add_stream(
partial_movie_file_codec,
rate=fps,
options=av_options,
Expand Down Expand Up @@ -643,7 +643,7 @@ def combine_files(
output_container.metadata["comment"] = (
f"Rendered with Manim Community v{__version__}"
)
output_stream = output_container.add_stream(
output_stream: Any = output_container.add_stream(
codec_name="gif" if create_gif else None,
template=partial_movies_stream if not create_gif else None,
)
Expand Down

0 comments on commit 4c14674

Please sign in to comment.