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.

Files changed (129) hide show
  1. manim/__main__.py +45 -12
  2. manim/_config/__init__.py +2 -2
  3. manim/_config/cli_colors.py +8 -4
  4. manim/_config/default.cfg +0 -2
  5. manim/_config/logger_utils.py +5 -0
  6. manim/_config/utils.py +29 -38
  7. manim/animation/animation.py +148 -8
  8. manim/animation/composition.py +16 -13
  9. manim/animation/creation.py +184 -8
  10. manim/animation/fading.py +5 -8
  11. manim/animation/indication.py +93 -26
  12. manim/animation/movement.py +21 -3
  13. manim/animation/rotation.py +2 -1
  14. manim/animation/specialized.py +3 -5
  15. manim/animation/speedmodifier.py +3 -3
  16. manim/animation/transform.py +4 -5
  17. manim/animation/updaters/mobject_update_utils.py +17 -14
  18. manim/camera/camera.py +2 -2
  19. manim/cli/__init__.py +17 -0
  20. manim/cli/cfg/group.py +52 -36
  21. manim/cli/checkhealth/checks.py +92 -76
  22. manim/cli/checkhealth/commands.py +12 -5
  23. manim/cli/default_group.py +148 -24
  24. manim/cli/init/commands.py +28 -23
  25. manim/cli/plugins/commands.py +13 -3
  26. manim/cli/render/commands.py +47 -42
  27. manim/cli/render/global_options.py +43 -9
  28. manim/cli/render/render_options.py +84 -19
  29. manim/constants.py +11 -4
  30. manim/mobject/frame.py +0 -1
  31. manim/mobject/geometry/arc.py +109 -75
  32. manim/mobject/geometry/boolean_ops.py +20 -17
  33. manim/mobject/geometry/labeled.py +300 -77
  34. manim/mobject/geometry/line.py +120 -60
  35. manim/mobject/geometry/polygram.py +109 -25
  36. manim/mobject/geometry/shape_matchers.py +35 -15
  37. manim/mobject/geometry/tips.py +36 -27
  38. manim/mobject/graph.py +48 -40
  39. manim/mobject/graphing/coordinate_systems.py +110 -45
  40. manim/mobject/graphing/functions.py +16 -10
  41. manim/mobject/graphing/number_line.py +23 -9
  42. manim/mobject/graphing/probability.py +2 -10
  43. manim/mobject/graphing/scale.py +6 -5
  44. manim/mobject/matrix.py +17 -19
  45. manim/mobject/mobject.py +149 -103
  46. manim/mobject/opengl/opengl_geometry.py +4 -8
  47. manim/mobject/opengl/opengl_mobject.py +506 -343
  48. manim/mobject/opengl/opengl_point_cloud_mobject.py +3 -7
  49. manim/mobject/opengl/opengl_surface.py +1 -2
  50. manim/mobject/opengl/opengl_vectorized_mobject.py +27 -65
  51. manim/mobject/svg/brace.py +61 -13
  52. manim/mobject/svg/svg_mobject.py +2 -1
  53. manim/mobject/table.py +11 -12
  54. manim/mobject/text/code_mobject.py +186 -550
  55. manim/mobject/text/numbers.py +7 -7
  56. manim/mobject/text/tex_mobject.py +22 -13
  57. manim/mobject/text/text_mobject.py +29 -20
  58. manim/mobject/three_d/polyhedra.py +98 -1
  59. manim/mobject/three_d/three_dimensions.py +59 -31
  60. manim/mobject/types/image_mobject.py +37 -23
  61. manim/mobject/types/point_cloud_mobject.py +103 -67
  62. manim/mobject/types/vectorized_mobject.py +387 -214
  63. manim/mobject/value_tracker.py +2 -1
  64. manim/mobject/vector_field.py +2 -4
  65. manim/opengl/__init__.py +3 -3
  66. manim/plugins/__init__.py +2 -3
  67. manim/plugins/plugins_flags.py +3 -3
  68. manim/renderer/cairo_renderer.py +11 -11
  69. manim/renderer/opengl_renderer.py +19 -20
  70. manim/renderer/shader.py +2 -3
  71. manim/renderer/shader_wrapper.py +3 -2
  72. manim/scene/moving_camera_scene.py +23 -0
  73. manim/scene/scene.py +72 -41
  74. manim/scene/scene_file_writer.py +313 -164
  75. manim/scene/section.py +15 -15
  76. manim/scene/three_d_scene.py +8 -15
  77. manim/scene/vector_space_scene.py +3 -6
  78. manim/typing.py +326 -66
  79. manim/utils/bezier.py +1658 -381
  80. manim/utils/caching.py +11 -5
  81. manim/utils/color/AS2700.py +2 -0
  82. manim/utils/color/BS381.py +2 -0
  83. manim/utils/color/DVIPSNAMES.py +96 -0
  84. manim/utils/color/SVGNAMES.py +179 -0
  85. manim/utils/color/X11.py +3 -0
  86. manim/utils/color/XKCD.py +2 -0
  87. manim/utils/color/__init__.py +8 -5
  88. manim/utils/color/core.py +818 -301
  89. manim/utils/color/manim_colors.py +7 -9
  90. manim/utils/commands.py +40 -19
  91. manim/utils/config_ops.py +18 -13
  92. manim/utils/debug.py +8 -6
  93. manim/utils/deprecation.py +92 -43
  94. manim/utils/docbuild/autoaliasattr_directive.py +45 -8
  95. manim/utils/docbuild/autocolor_directive.py +12 -13
  96. manim/utils/docbuild/manim_directive.py +35 -29
  97. manim/utils/docbuild/module_parsing.py +74 -27
  98. manim/utils/family.py +3 -3
  99. manim/utils/family_ops.py +12 -4
  100. manim/utils/file_ops.py +22 -16
  101. manim/utils/hashing.py +7 -7
  102. manim/utils/images.py +10 -4
  103. manim/utils/ipython_magic.py +12 -8
  104. manim/utils/iterables.py +161 -119
  105. manim/utils/module_ops.py +55 -19
  106. manim/utils/opengl.py +68 -23
  107. manim/utils/parameter_parsing.py +3 -2
  108. manim/utils/paths.py +11 -5
  109. manim/utils/polylabel.py +168 -0
  110. manim/utils/qhull.py +218 -0
  111. manim/utils/rate_functions.py +69 -32
  112. manim/utils/simple_functions.py +24 -15
  113. manim/utils/sounds.py +7 -1
  114. manim/utils/space_ops.py +48 -37
  115. manim/utils/testing/_frames_testers.py +13 -8
  116. manim/utils/testing/_show_diff.py +5 -3
  117. manim/utils/testing/_test_class_makers.py +33 -18
  118. manim/utils/testing/frames_comparison.py +20 -14
  119. manim/utils/tex.py +4 -2
  120. manim/utils/tex_file_writing.py +45 -45
  121. manim/utils/tex_templates.py +1 -1
  122. manim/utils/unit.py +6 -5
  123. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/METADATA +16 -9
  124. manim-0.19.0.dist-info/RECORD +221 -0
  125. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/WHEEL +1 -1
  126. manim-0.18.1.dist-info/RECORD +0 -217
  127. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/LICENSE +0 -0
  128. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/LICENSE.community +0 -0
  129. {manim-0.18.1.dist-info → manim-0.19.0.dist-info}/entry_points.txt +0 -0
@@ -1,7 +1,8 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import math
4
- from typing import TYPE_CHECKING, Any, Iterable
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
- func = lambda value, base: np.log(value) / np.log(base)
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 typing import Iterable, Sequence
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, "\\pi"], [-1, 1]])
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="\\\\langle",
136
- right_bracket="\\\\rangle")
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([["\\pi", 3], [1, 5]])
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
  --------