|
20 | 20 | import re |
21 | 21 | import sys |
22 | 22 | from collections.abc import Mapping, MutableMapping |
23 | | -from enum import EnumMeta |
24 | 23 | from pathlib import Path |
25 | | -from typing import Any, ClassVar, Iterable, Iterator, NoReturn |
| 24 | +from typing import TYPE_CHECKING, Any, ClassVar, Iterable, Iterator, NoReturn |
26 | 25 |
|
27 | 26 | import numpy as np |
28 | | -from typing_extensions import Self |
29 | 27 |
|
30 | | -from .. import constants |
31 | | -from ..constants import RendererType |
32 | | -from ..typing import StrPath, Vector3 |
33 | | -from ..utils.color import ManimColor |
34 | | -from ..utils.tex import TexTemplate, TexTemplateFromFile |
| 28 | +from manim import constants |
| 29 | +from manim.constants import RendererType |
| 30 | +from manim.utils.color import ManimColor |
| 31 | +from manim.utils.tex import TexTemplate, TexTemplateFromFile |
| 32 | + |
| 33 | +if TYPE_CHECKING: |
| 34 | + from enum import EnumMeta |
| 35 | + |
| 36 | + from typing_extensions import Self |
| 37 | + |
| 38 | + from manim.typing import StrPath, Vector3D |
| 39 | + |
| 40 | +__all__ = ["config_file_paths", "make_config_parser", "ManimConfig", "ManimFrame"] |
35 | 41 |
|
36 | 42 |
|
37 | 43 | def config_file_paths() -> list[Path]: |
@@ -1145,22 +1151,22 @@ def frame_x_radius(self, value: float) -> None: |
1145 | 1151 | ) |
1146 | 1152 |
|
1147 | 1153 | @property |
1148 | | - def top(self) -> Vector3: |
| 1154 | + def top(self) -> Vector3D: |
1149 | 1155 | """Coordinate at the center top of the frame.""" |
1150 | 1156 | return self.frame_y_radius * constants.UP |
1151 | 1157 |
|
1152 | 1158 | @property |
1153 | | - def bottom(self) -> Vector3: |
| 1159 | + def bottom(self) -> Vector3D: |
1154 | 1160 | """Coordinate at the center bottom of the frame.""" |
1155 | 1161 | return self.frame_y_radius * constants.DOWN |
1156 | 1162 |
|
1157 | 1163 | @property |
1158 | | - def left_side(self) -> Vector3: |
| 1164 | + def left_side(self) -> Vector3D: |
1159 | 1165 | """Coordinate at the middle left of the frame.""" |
1160 | 1166 | return self.frame_x_radius * constants.LEFT |
1161 | 1167 |
|
1162 | 1168 | @property |
1163 | | - def right_side(self) -> Vector3: |
| 1169 | + def right_side(self) -> Vector3D: |
1164 | 1170 | """Coordinate at the middle right of the frame.""" |
1165 | 1171 | return self.frame_x_radius * constants.RIGHT |
1166 | 1172 |
|
@@ -1801,7 +1807,7 @@ class ManimFrame(Mapping): |
1801 | 1807 | "left_side", |
1802 | 1808 | "right_side", |
1803 | 1809 | } |
1804 | | - _CONSTANTS: ClassVar[dict[str, Vector3]] = { |
| 1810 | + _CONSTANTS: ClassVar[dict[str, Vector3D]] = { |
1805 | 1811 | "UP": np.array((0.0, 1.0, 0.0)), |
1806 | 1812 | "DOWN": np.array((0.0, -1.0, 0.0)), |
1807 | 1813 | "RIGHT": np.array((1.0, 0.0, 0.0)), |
|
0 commit comments