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
manim/scene/section.py CHANGED
@@ -34,23 +34,23 @@ class DefaultSectionType(str, Enum):
34
34
 
35
35
 
36
36
  class Section:
37
- """A :class:`.Scene` can be segmented into multiple Sections.
37
+ r"""A :class:`.Scene` can be segmented into multiple Sections.
38
38
  Refer to :doc:`the documentation</tutorials/output_and_config>` for more info.
39
39
  It consists of multiple animations.
40
40
 
41
41
  Attributes
42
42
  ----------
43
- type
44
- Can be used by a third party applications to classify different types of sections.
45
- video
46
- Path to video file with animations belonging to section relative to sections directory.
47
- If ``None``, then the section will not be saved.
48
- name
49
- Human readable, non-unique name for this section.
50
- skip_animations
51
- Skip rendering the animations in this section when ``True``.
52
- partial_movie_files
53
- Animations belonging to this section.
43
+ type\_
44
+ Can be used by a third party applications to classify different types of sections.
45
+ video
46
+ Path to video file with animations belonging to section relative to sections directory.
47
+ If ``None``, then the section will not be saved.
48
+ name
49
+ Human readable, non-unique name for this section.
50
+ skip_animations
51
+ Skip rendering the animations in this section when ``True``.
52
+ partial_movie_files
53
+ Animations belonging to this section.
54
54
 
55
55
  See Also
56
56
  --------
@@ -59,8 +59,8 @@ class Section:
59
59
  :meth:`.OpenGLRenderer.update_skipping_status`
60
60
  """
61
61
 
62
- def __init__(self, type: str, video: str | None, name: str, skip_animations: bool):
63
- self.type = type
62
+ def __init__(self, type_: str, video: str | None, name: str, skip_animations: bool):
63
+ self.type_ = type_
64
64
  # None when not to be saved -> still keeps section alive
65
65
  self.video: str | None = video
66
66
  self.name = name
@@ -94,7 +94,7 @@ class Section:
94
94
  return dict(
95
95
  {
96
96
  "name": self.name,
97
- "type": self.type,
97
+ "type": self.type_,
98
98
  "video": self.video,
99
99
  },
100
100
  **video_metadata,
@@ -6,7 +6,7 @@ __all__ = ["ThreeDScene", "SpecialThreeDScene"]
6
6
 
7
7
 
8
8
  import warnings
9
- from typing import Iterable, Sequence
9
+ from collections.abc import Iterable, Sequence
10
10
 
11
11
  import numpy as np
12
12
 
@@ -86,7 +86,6 @@ class ThreeDScene(Scene):
86
86
  The new center of the camera frame in cartesian coordinates.
87
87
 
88
88
  """
89
-
90
89
  if phi is not None:
91
90
  self.renderer.camera.set_phi(phi)
92
91
  if theta is not None:
@@ -135,13 +134,11 @@ class ThreeDScene(Scene):
135
134
  }
136
135
  cam.add_updater(lambda m, dt: methods[about](rate * dt))
137
136
  self.add(self.camera)
138
- except Exception:
139
- raise ValueError("Invalid ambient rotation angle.")
137
+ except Exception as e:
138
+ raise ValueError("Invalid ambient rotation angle.") from e
140
139
 
141
140
  def stop_ambient_camera_rotation(self, about="theta"):
142
- """
143
- This method stops all ambient camera rotation.
144
- """
141
+ """This method stops all ambient camera rotation."""
145
142
  about: str = about.lower()
146
143
  try:
147
144
  if config.renderer == RendererType.CAIRO:
@@ -155,8 +152,8 @@ class ThreeDScene(Scene):
155
152
  self.remove(x)
156
153
  elif config.renderer == RendererType.OPENGL:
157
154
  self.camera.clear_updaters()
158
- except Exception:
159
- raise ValueError("Invalid ambient rotation angle.")
155
+ except Exception as e:
156
+ raise ValueError("Invalid ambient rotation angle.") from e
160
157
 
161
158
  def begin_3dillusion_camera_rotation(
162
159
  self,
@@ -205,9 +202,7 @@ class ThreeDScene(Scene):
205
202
  self.add(self.renderer.camera.phi_tracker)
206
203
 
207
204
  def stop_3dillusion_camera_rotation(self):
208
- """
209
- This method stops all illusion camera rotations.
210
- """
205
+ """This method stops all illusion camera rotations."""
211
206
  self.renderer.camera.theta_tracker.clear_updaters()
212
207
  self.remove(self.renderer.camera.theta_tracker)
213
208
  self.renderer.camera.phi_tracker.clear_updaters()
@@ -545,7 +540,5 @@ class SpecialThreeDScene(ThreeDScene):
545
540
  return self.default_angled_camera_position
546
541
 
547
542
  def set_camera_to_default_position(self):
548
- """
549
- Sets the camera to its default position.
550
- """
543
+ """Sets the camera to its default position."""
551
544
  self.set_camera_orientation(**self.default_angled_camera_position)
@@ -297,7 +297,7 @@ class VectorScene(Scene):
297
297
  """
298
298
  if not isinstance(label, MathTex):
299
299
  if len(label) == 1:
300
- label = "\\vec{\\textbf{%s}}" % label
300
+ label = "\\vec{\\textbf{%s}}" % label # noqa: UP031
301
301
  label = MathTex(label)
302
302
  if color is None:
303
303
  color = vector.get_color()
@@ -904,9 +904,8 @@ class LinearTransformationScene(VectorScene):
904
904
  if new_label:
905
905
  label_mob.target_text = new_label
906
906
  else:
907
- label_mob.target_text = "{}({})".format(
908
- transformation_name,
909
- label_mob.get_tex_string(),
907
+ label_mob.target_text = (
908
+ f"{transformation_name}({label_mob.get_tex_string()})"
910
909
  )
911
910
  label_mob.vector = vector
912
911
  label_mob.kwargs = kwargs
@@ -1003,7 +1002,6 @@ class LinearTransformationScene(VectorScene):
1003
1002
  Animation
1004
1003
  The animation of the movement.
1005
1004
  """
1006
-
1007
1005
  v_pieces = [piece for piece in pieces if isinstance(piece, VMobject)]
1008
1006
  start = VGroup(*v_pieces)
1009
1007
  target = VGroup(*(mob.target for mob in v_pieces))
@@ -1094,7 +1092,6 @@ class LinearTransformationScene(VectorScene):
1094
1092
  **kwargs
1095
1093
  Any valid keyword argument of self.apply_transposed_matrix()
1096
1094
  """
1097
-
1098
1095
  self.apply_transposed_matrix(np.array(matrix).T, **kwargs)
1099
1096
 
1100
1097
  def apply_inverse(self, matrix: np.ndarray | list | tuple, **kwargs):