manim 0.18.1__py3-none-any.whl → 0.19.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of manim might be problematic. Click here for more details.
- manim/__main__.py +45 -12
- manim/_config/__init__.py +2 -2
- manim/_config/cli_colors.py +8 -4
- manim/_config/default.cfg +0 -2
- manim/_config/logger_utils.py +5 -0
- manim/_config/utils.py +29 -38
- manim/animation/animation.py +148 -8
- manim/animation/composition.py +16 -13
- manim/animation/creation.py +184 -8
- manim/animation/fading.py +5 -8
- manim/animation/indication.py +93 -26
- manim/animation/movement.py +21 -3
- manim/animation/rotation.py +2 -1
- manim/animation/specialized.py +3 -5
- manim/animation/speedmodifier.py +3 -3
- manim/animation/transform.py +4 -5
- manim/animation/updaters/mobject_update_utils.py +17 -14
- manim/camera/camera.py +2 -2
- manim/cli/__init__.py +17 -0
- manim/cli/cfg/group.py +52 -36
- manim/cli/checkhealth/checks.py +92 -76
- manim/cli/checkhealth/commands.py +12 -5
- manim/cli/default_group.py +148 -24
- manim/cli/init/commands.py +28 -23
- manim/cli/plugins/commands.py +13 -3
- manim/cli/render/commands.py +47 -42
- manim/cli/render/global_options.py +43 -9
- manim/cli/render/render_options.py +84 -19
- manim/constants.py +11 -4
- manim/mobject/frame.py +0 -1
- manim/mobject/geometry/arc.py +109 -75
- manim/mobject/geometry/boolean_ops.py +20 -17
- manim/mobject/geometry/labeled.py +300 -77
- manim/mobject/geometry/line.py +120 -60
- manim/mobject/geometry/polygram.py +109 -25
- manim/mobject/geometry/shape_matchers.py +35 -15
- manim/mobject/geometry/tips.py +36 -27
- manim/mobject/graph.py +48 -40
- manim/mobject/graphing/coordinate_systems.py +110 -45
- manim/mobject/graphing/functions.py +16 -10
- manim/mobject/graphing/number_line.py +23 -9
- manim/mobject/graphing/probability.py +2 -10
- manim/mobject/graphing/scale.py +6 -5
- manim/mobject/matrix.py +17 -19
- manim/mobject/mobject.py +149 -103
- manim/mobject/opengl/opengl_geometry.py +4 -8
- manim/mobject/opengl/opengl_mobject.py +506 -343
- manim/mobject/opengl/opengl_point_cloud_mobject.py +3 -7
- manim/mobject/opengl/opengl_surface.py +1 -2
- manim/mobject/opengl/opengl_vectorized_mobject.py +27 -65
- manim/mobject/svg/brace.py +61 -13
- manim/mobject/svg/svg_mobject.py +2 -1
- manim/mobject/table.py +11 -12
- manim/mobject/text/code_mobject.py +186 -550
- manim/mobject/text/numbers.py +7 -7
- manim/mobject/text/tex_mobject.py +22 -13
- manim/mobject/text/text_mobject.py +29 -20
- manim/mobject/three_d/polyhedra.py +98 -1
- manim/mobject/three_d/three_dimensions.py +59 -31
- manim/mobject/types/image_mobject.py +37 -23
- manim/mobject/types/point_cloud_mobject.py +103 -67
- manim/mobject/types/vectorized_mobject.py +387 -214
- manim/mobject/value_tracker.py +2 -1
- manim/mobject/vector_field.py +2 -4
- manim/opengl/__init__.py +3 -3
- manim/plugins/__init__.py +2 -3
- manim/plugins/plugins_flags.py +3 -3
- manim/renderer/cairo_renderer.py +11 -11
- manim/renderer/opengl_renderer.py +19 -20
- manim/renderer/shader.py +2 -3
- manim/renderer/shader_wrapper.py +3 -2
- manim/scene/moving_camera_scene.py +23 -0
- manim/scene/scene.py +72 -41
- manim/scene/scene_file_writer.py +313 -164
- manim/scene/section.py +15 -15
- manim/scene/three_d_scene.py +8 -15
- manim/scene/vector_space_scene.py +3 -6
- manim/typing.py +326 -66
- manim/utils/bezier.py +1658 -381
- manim/utils/caching.py +11 -5
- manim/utils/color/AS2700.py +2 -0
- manim/utils/color/BS381.py +2 -0
- manim/utils/color/DVIPSNAMES.py +96 -0
- manim/utils/color/SVGNAMES.py +179 -0
- manim/utils/color/X11.py +3 -0
- manim/utils/color/XKCD.py +2 -0
- manim/utils/color/__init__.py +8 -5
- manim/utils/color/core.py +818 -301
- manim/utils/color/manim_colors.py +7 -9
- manim/utils/commands.py +40 -19
- manim/utils/config_ops.py +18 -13
- manim/utils/debug.py +8 -6
- manim/utils/deprecation.py +92 -43
- manim/utils/docbuild/autoaliasattr_directive.py +45 -8
- manim/utils/docbuild/autocolor_directive.py +12 -13
- manim/utils/docbuild/manim_directive.py +35 -29
- manim/utils/docbuild/module_parsing.py +74 -27
- manim/utils/family.py +3 -3
- manim/utils/family_ops.py +12 -4
- manim/utils/file_ops.py +22 -16
- manim/utils/hashing.py +7 -7
- manim/utils/images.py +10 -4
- manim/utils/ipython_magic.py +12 -8
- manim/utils/iterables.py +161 -119
- manim/utils/module_ops.py +55 -19
- manim/utils/opengl.py +68 -23
- manim/utils/parameter_parsing.py +3 -2
- manim/utils/paths.py +11 -5
- manim/utils/polylabel.py +168 -0
- manim/utils/qhull.py +218 -0
- manim/utils/rate_functions.py +69 -32
- manim/utils/simple_functions.py +24 -15
- manim/utils/sounds.py +7 -1
- manim/utils/space_ops.py +48 -37
- manim/utils/testing/_frames_testers.py +13 -8
- manim/utils/testing/_show_diff.py +5 -3
- manim/utils/testing/_test_class_makers.py +33 -18
- manim/utils/testing/frames_comparison.py +20 -14
- manim/utils/tex.py +4 -2
- manim/utils/tex_file_writing.py +45 -45
- manim/utils/tex_templates.py +1 -1
- manim/utils/unit.py +6 -5
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/METADATA +16 -9
- manim-0.19.0.dist-info/RECORD +221 -0
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/WHEEL +1 -1
- manim-0.18.1.dist-info/RECORD +0 -217
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/LICENSE +0 -0
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/LICENSE.community +0 -0
- {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/entry_points.txt +0 -0
manim/mobject/graphing/scale.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import math
|
|
4
|
-
from
|
|
4
|
+
from collections.abc import Iterable
|
|
5
|
+
from typing import TYPE_CHECKING, Any
|
|
5
6
|
|
|
6
7
|
import numpy as np
|
|
7
8
|
|
|
@@ -89,7 +90,6 @@ class LinearBase(_ScaleBase):
|
|
|
89
90
|
scale_factor
|
|
90
91
|
The slope of the linear function, by default 1.0
|
|
91
92
|
"""
|
|
92
|
-
|
|
93
93
|
super().__init__()
|
|
94
94
|
self.scale_factor = scale_factor
|
|
95
95
|
|
|
@@ -145,7 +145,9 @@ class LogBase(_ScaleBase):
|
|
|
145
145
|
"""Inverse of ``function``. The value must be greater than 0"""
|
|
146
146
|
if isinstance(value, np.ndarray):
|
|
147
147
|
condition = value.any() <= 0
|
|
148
|
-
|
|
148
|
+
|
|
149
|
+
def func(value, base):
|
|
150
|
+
return np.log(value) / np.log(base)
|
|
149
151
|
else:
|
|
150
152
|
condition = value <= 0
|
|
151
153
|
func = math.log
|
|
@@ -174,12 +176,11 @@ class LogBase(_ScaleBase):
|
|
|
174
176
|
base_config
|
|
175
177
|
Additional arguments to be passed to :class:`~.Integer`.
|
|
176
178
|
"""
|
|
177
|
-
|
|
178
179
|
# uses `format` syntax to control the number of decimal places.
|
|
179
180
|
tex_labels = [
|
|
180
181
|
Integer(
|
|
181
182
|
self.base,
|
|
182
|
-
unit="^{%s}" % (f"{self.inverse_function(i):.{unit_decimal_places}f}"),
|
|
183
|
+
unit="^{%s}" % (f"{self.inverse_function(i):.{unit_decimal_places}f}"), # noqa: UP031
|
|
183
184
|
**base_config,
|
|
184
185
|
)
|
|
185
186
|
for i in val_range
|
manim/mobject/matrix.py
CHANGED
|
@@ -15,8 +15,8 @@ Examples
|
|
|
15
15
|
m2 = DecimalMatrix(
|
|
16
16
|
[[3.456, 2.122], [33.2244, 12.33]],
|
|
17
17
|
element_to_mobject_config={"num_decimal_places": 2},
|
|
18
|
-
left_bracket="
|
|
19
|
-
right_bracket="
|
|
18
|
+
left_bracket=r"\{",
|
|
19
|
+
right_bracket=r"\}")
|
|
20
20
|
m3 = MobjectMatrix(
|
|
21
21
|
[[Circle().scale(0.3), Square().scale(0.3)],
|
|
22
22
|
[MathTex("\\pi").scale(2), Star().scale(0.3)]],
|
|
@@ -40,7 +40,7 @@ __all__ = [
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
import itertools as it
|
|
43
|
-
from
|
|
43
|
+
from collections.abc import Iterable, Sequence
|
|
44
44
|
|
|
45
45
|
import numpy as np
|
|
46
46
|
|
|
@@ -72,7 +72,7 @@ def matrix_to_mobject(matrix):
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
75
|
-
"""A mobject that displays a matrix on the screen.
|
|
75
|
+
r"""A mobject that displays a matrix on the screen.
|
|
76
76
|
|
|
77
77
|
Parameters
|
|
78
78
|
----------
|
|
@@ -118,22 +118,22 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
|
118
118
|
|
|
119
119
|
class MatrixExamples(Scene):
|
|
120
120
|
def construct(self):
|
|
121
|
-
m0 = Matrix([[2, "
|
|
121
|
+
m0 = Matrix([[2, r"\pi"], [-1, 1]])
|
|
122
122
|
m1 = Matrix([[2, 0, 4], [-1, 1, 5]],
|
|
123
123
|
v_buff=1.3,
|
|
124
124
|
h_buff=0.8,
|
|
125
125
|
bracket_h_buff=SMALL_BUFF,
|
|
126
126
|
bracket_v_buff=SMALL_BUFF,
|
|
127
|
-
left_bracket="
|
|
128
|
-
right_bracket="
|
|
127
|
+
left_bracket=r"\{",
|
|
128
|
+
right_bracket=r"\}")
|
|
129
129
|
m1.add(SurroundingRectangle(m1.get_columns()[1]))
|
|
130
130
|
m2 = Matrix([[2, 1], [-1, 3]],
|
|
131
131
|
element_alignment_corner=UL,
|
|
132
132
|
left_bracket="(",
|
|
133
133
|
right_bracket=")")
|
|
134
134
|
m3 = Matrix([[2, 1], [-1, 3]],
|
|
135
|
-
left_bracket="
|
|
136
|
-
right_bracket="
|
|
135
|
+
left_bracket=r"\langle",
|
|
136
|
+
right_bracket=r"\rangle")
|
|
137
137
|
m4 = Matrix([[2, 1], [-1, 3]],
|
|
138
138
|
).set_column_colors(RED, GREEN)
|
|
139
139
|
m5 = Matrix([[2, 1], [-1, 3]],
|
|
@@ -241,7 +241,6 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
|
241
241
|
:class:`Matrix`
|
|
242
242
|
The current matrix object (self).
|
|
243
243
|
"""
|
|
244
|
-
|
|
245
244
|
# Height per row of LaTeX array with default settings
|
|
246
245
|
BRACKET_HEIGHT = 0.5977
|
|
247
246
|
|
|
@@ -280,7 +279,7 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
|
280
279
|
return self
|
|
281
280
|
|
|
282
281
|
def get_columns(self):
|
|
283
|
-
"""Return columns of the matrix as VGroups.
|
|
282
|
+
r"""Return columns of the matrix as VGroups.
|
|
284
283
|
|
|
285
284
|
Returns
|
|
286
285
|
--------
|
|
@@ -295,11 +294,10 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
|
295
294
|
|
|
296
295
|
class GetColumnsExample(Scene):
|
|
297
296
|
def construct(self):
|
|
298
|
-
m0 = Matrix([["
|
|
297
|
+
m0 = Matrix([[r"\pi", 3], [1, 5]])
|
|
299
298
|
m0.add(SurroundingRectangle(m0.get_columns()[1]))
|
|
300
299
|
self.add(m0)
|
|
301
300
|
"""
|
|
302
|
-
|
|
303
301
|
return VGroup(
|
|
304
302
|
*(
|
|
305
303
|
VGroup(*(row[i] for row in self.mob_matrix))
|
|
@@ -308,7 +306,7 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
|
308
306
|
)
|
|
309
307
|
|
|
310
308
|
def set_column_colors(self, *colors: str):
|
|
311
|
-
"""Set individual colors for each columns of the matrix.
|
|
309
|
+
r"""Set individual colors for each columns of the matrix.
|
|
312
310
|
|
|
313
311
|
Parameters
|
|
314
312
|
----------
|
|
@@ -338,7 +336,7 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
|
338
336
|
return self
|
|
339
337
|
|
|
340
338
|
def get_rows(self):
|
|
341
|
-
"""Return rows of the matrix as VGroups.
|
|
339
|
+
r"""Return rows of the matrix as VGroups.
|
|
342
340
|
|
|
343
341
|
Returns
|
|
344
342
|
--------
|
|
@@ -360,7 +358,7 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
|
360
358
|
return VGroup(*(VGroup(*row) for row in self.mob_matrix))
|
|
361
359
|
|
|
362
360
|
def set_row_colors(self, *colors: str):
|
|
363
|
-
"""Set individual colors for each row of the matrix.
|
|
361
|
+
r"""Set individual colors for each row of the matrix.
|
|
364
362
|
|
|
365
363
|
Parameters
|
|
366
364
|
----------
|
|
@@ -438,7 +436,7 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
|
438
436
|
return self.elements
|
|
439
437
|
|
|
440
438
|
def get_brackets(self):
|
|
441
|
-
"""Return the bracket mobjects.
|
|
439
|
+
r"""Return the bracket mobjects.
|
|
442
440
|
|
|
443
441
|
Returns
|
|
444
442
|
--------
|
|
@@ -464,7 +462,7 @@ class Matrix(VMobject, metaclass=ConvertToOpenGL):
|
|
|
464
462
|
|
|
465
463
|
|
|
466
464
|
class DecimalMatrix(Matrix):
|
|
467
|
-
"""A mobject that displays a matrix with decimal entries on the screen.
|
|
465
|
+
r"""A mobject that displays a matrix with decimal entries on the screen.
|
|
468
466
|
|
|
469
467
|
Examples
|
|
470
468
|
--------
|
|
@@ -544,7 +542,7 @@ class IntegerMatrix(Matrix):
|
|
|
544
542
|
|
|
545
543
|
|
|
546
544
|
class MobjectMatrix(Matrix):
|
|
547
|
-
"""A mobject that displays a matrix of mobject entries on the screen.
|
|
545
|
+
r"""A mobject that displays a matrix of mobject entries on the screen.
|
|
548
546
|
|
|
549
547
|
Examples
|
|
550
548
|
--------
|