Skip to content

Commit 44a0dee

Browse files
committed
Address review comments
1 parent d06faaf commit 44a0dee

File tree

6 files changed

+22
-29
lines changed

6 files changed

+22
-29
lines changed

manim/__main__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
1-
import inspect
21
import os
32
import platform
4-
import subprocess as sp
53
import sys
6-
import re
74
import traceback
8-
import importlib.util
9-
import types
105

11-
from . import constants, logger, console, file_writer_config
6+
from . import logger, file_writer_config
127
from .config.config import camera_config, args
138
from .config import cfg_subcmds
149
from .utils.module_ops import (
1510
get_module,
1611
get_scene_classes_from_module,
1712
get_scenes_to_render,
1813
)
19-
from .scene.scene import Scene
2014
from .utils.file_ops import open_file as open_media_file
2115
from .grpc.impl import frame_server_impl
22-
from .renderer.cairo_renderer import CairoRenderer
2316

2417

2518
def open_file_if_needed(file_writer):

manim/renderer/cairo_renderer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import numpy as np
2-
from .. import config, camera_config, file_writer_config, logger
2+
from .. import config, camera_config, file_writer_config
33
from ..utils.iterables import list_update
44
from ..utils.exceptions import EndSceneEarlyException
5-
from ..utils.hashing import get_hash_from_play_call, get_hash_from_wait_call
65
from ..constants import DEFAULT_WAIT_TIME
76
from ..scene.scene_file_writer import SceneFileWriter
87
from ..utils.caching import handle_caching_play, handle_caching_wait

manim/utils/caching.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@
44

55

66
def handle_caching_play(func):
7-
"""
8-
Decorator that returns a wrapped version of func that will compute the hash of the play invocation.
7+
"""Decorator that returns a wrapped version of func that will compute
8+
the hash of the play invocation.
99
10-
The returned function will act according to the computed hash: either skip the animation because it's already cached, or let the invoked function play normally.
10+
The returned function will act according to the computed hash: either skip
11+
the animation because it's already cached, or let the invoked function
12+
play normally.
1113
1214
Parameters
1315
----------
1416
func : Callable[[...], None]
15-
The play like function that has to be written to the video file stream. Take the same parameters as `scene.play`.
17+
The play like function that has to be written to the video file stream.
18+
Take the same parameters as `scene.play`.
1619
"""
1720

1821
def wrapper(self, scene, *args, **kwargs):
@@ -53,15 +56,17 @@ def wrapper(self, scene, *args, **kwargs):
5356

5457

5558
def handle_caching_wait(func):
56-
"""
57-
Decorator that returns a wrapped version of func that will compute the hash of the wait invocation.
59+
"""Decorator that returns a wrapped version of func that will compute the hash of
60+
the wait invocation.
5861
59-
The returned function will act according to the computed hash: either skip the animation because it's already cached, or let the invoked function play normally.
62+
The returned function will act according to the computed hash: either skip the
63+
animation because it's already cached, or let the invoked function play normally.
6064
6165
Parameters
6266
----------
6367
func : Callable[[...], None]
64-
The wait like function that has to be written to the video file stream. Take the same parameters as `scene.wait`.
68+
The wait like function that has to be written to the video file stream.
69+
Take the same parameters as `scene.wait`.
6570
"""
6671

6772
def wrapper(self, scene, duration=DEFAULT_WAIT_TIME, stop_condition=None):
@@ -89,7 +94,7 @@ def wrapper(self, scene, duration=DEFAULT_WAIT_TIME, stop_condition=None):
8994
self.animations_hashes.append(hash_wait)
9095
self.file_writer.add_partial_movie_file(hash_wait)
9196
logger.debug(
92-
"Animations hashes list of the scene : (concatened to 5) %(h)s",
97+
"List of the first few animation hashes of the scene: %(h)s",
9398
{"h": str(self.animations_hashes[:5])},
9499
)
95100
func(self, scene, duration, stop_condition)

manim/utils/family.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
def extract_mobject_family_members(
88
mobjects, use_z_index=False, only_those_with_points=False
99
):
10-
"""Returns a list of the types of mobjects and
11-
their family members present.
10+
"""Returns a list of the types of mobjects and their family members present.
11+
A "family" in this context refers to a mobject, its submobjects, and their
12+
submobjects, recursively.
1213
1314
Parameters
1415
----------

tests/test_container.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from manim import Container, Mobject, Scene, CairoRenderer
2+
from manim import Container, Mobject, Scene
33

44

55
def test_ABC():

tests/utils/GraphicalUnitTester.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
import numpy as np
21
import os
3-
import sys
4-
import inspect
52
import logging
6-
import pytest
7-
import warnings
8-
from platform import system
3+
import numpy as np
94

10-
from manim import config, file_writer_config, CairoRenderer
5+
from manim import config, file_writer_config
116

127

138
class GraphicalUnitTester:

0 commit comments

Comments
 (0)