manim 0.17.0__py3-none-any.whl → 0.19.1__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.
Files changed (163) hide show
  1. manim/__init__.py +11 -6
  2. manim/__main__.py +62 -19
  3. manim/_config/__init__.py +10 -9
  4. manim/_config/cli_colors.py +26 -9
  5. manim/_config/default.cfg +1 -3
  6. manim/_config/logger_utils.py +23 -13
  7. manim/_config/utils.py +662 -468
  8. manim/animation/animation.py +164 -18
  9. manim/animation/changing.py +34 -23
  10. manim/animation/composition.py +265 -67
  11. manim/animation/creation.py +208 -26
  12. manim/animation/fading.py +16 -18
  13. manim/animation/growing.py +35 -15
  14. manim/animation/indication.py +150 -76
  15. manim/animation/movement.py +56 -22
  16. manim/animation/numbers.py +64 -6
  17. manim/animation/rotation.py +78 -7
  18. manim/animation/specialized.py +6 -7
  19. manim/animation/speedmodifier.py +13 -10
  20. manim/animation/transform.py +14 -11
  21. manim/animation/transform_matching_parts.py +3 -4
  22. manim/animation/updaters/mobject_update_utils.py +152 -30
  23. manim/animation/updaters/update.py +10 -7
  24. manim/camera/camera.py +182 -118
  25. manim/camera/mapping_camera.py +34 -3
  26. manim/camera/moving_camera.py +95 -74
  27. manim/camera/multi_camera.py +23 -15
  28. manim/camera/three_d_camera.py +70 -52
  29. manim/cli/__init__.py +17 -0
  30. manim/cli/cfg/group.py +76 -44
  31. manim/cli/checkhealth/checks.py +192 -0
  32. manim/cli/checkhealth/commands.py +90 -0
  33. manim/cli/default_group.py +158 -25
  34. manim/cli/init/commands.py +33 -25
  35. manim/cli/plugins/commands.py +16 -3
  36. manim/cli/render/commands.py +72 -60
  37. manim/cli/render/ease_of_access_options.py +4 -3
  38. manim/cli/render/global_options.py +59 -17
  39. manim/cli/render/output_options.py +6 -5
  40. manim/cli/render/render_options.py +98 -33
  41. manim/constants.py +109 -59
  42. manim/data_structures.py +31 -0
  43. manim/mobject/frame.py +8 -5
  44. manim/mobject/geometry/__init__.py +1 -0
  45. manim/mobject/geometry/arc.py +277 -135
  46. manim/mobject/geometry/boolean_ops.py +32 -31
  47. manim/mobject/geometry/labeled.py +376 -0
  48. manim/mobject/geometry/line.py +192 -87
  49. manim/mobject/geometry/polygram.py +224 -58
  50. manim/mobject/geometry/shape_matchers.py +61 -25
  51. manim/mobject/geometry/tips.py +122 -48
  52. manim/mobject/graph.py +1027 -419
  53. manim/mobject/graphing/coordinate_systems.py +533 -278
  54. manim/mobject/graphing/functions.py +53 -32
  55. manim/mobject/graphing/number_line.py +123 -65
  56. manim/mobject/graphing/probability.py +88 -62
  57. manim/mobject/graphing/scale.py +33 -19
  58. manim/mobject/logo.py +118 -28
  59. manim/mobject/matrix.py +87 -83
  60. manim/mobject/mobject.py +912 -442
  61. manim/mobject/opengl/dot_cloud.py +16 -5
  62. manim/mobject/opengl/opengl_compatibility.py +4 -2
  63. manim/mobject/opengl/opengl_geometry.py +254 -153
  64. manim/mobject/opengl/opengl_image_mobject.py +3 -1
  65. manim/mobject/opengl/opengl_mobject.py +779 -482
  66. manim/mobject/opengl/opengl_point_cloud_mobject.py +41 -14
  67. manim/mobject/opengl/opengl_surface.py +14 -92
  68. manim/mobject/opengl/opengl_three_dimensions.py +12 -8
  69. manim/mobject/opengl/opengl_vectorized_mobject.py +98 -100
  70. manim/mobject/svg/brace.py +173 -41
  71. manim/mobject/svg/svg_mobject.py +139 -53
  72. manim/mobject/table.py +61 -68
  73. manim/mobject/text/code_mobject.py +193 -539
  74. manim/mobject/text/numbers.py +81 -34
  75. manim/mobject/text/tex_mobject.py +130 -78
  76. manim/mobject/text/text_mobject.py +288 -164
  77. manim/mobject/three_d/polyhedra.py +111 -13
  78. manim/mobject/three_d/three_d_utils.py +17 -8
  79. manim/mobject/three_d/three_dimensions.py +239 -106
  80. manim/mobject/types/image_mobject.py +50 -30
  81. manim/mobject/types/point_cloud_mobject.py +120 -75
  82. manim/mobject/types/vectorized_mobject.py +841 -408
  83. manim/mobject/value_tracker.py +105 -38
  84. manim/mobject/vector_field.py +50 -31
  85. manim/opengl/__init__.py +3 -3
  86. manim/plugins/__init__.py +14 -1
  87. manim/plugins/plugins_flags.py +10 -14
  88. manim/renderer/cairo_renderer.py +65 -50
  89. manim/renderer/opengl_renderer.py +89 -69
  90. manim/renderer/opengl_renderer_window.py +39 -18
  91. manim/renderer/shader.py +123 -87
  92. manim/renderer/shader_wrapper.py +44 -28
  93. manim/renderer/vectorized_mobject_rendering.py +38 -10
  94. manim/scene/moving_camera_scene.py +32 -3
  95. manim/scene/scene.py +507 -242
  96. manim/scene/scene_file_writer.py +371 -220
  97. manim/scene/section.py +20 -16
  98. manim/scene/three_d_scene.py +14 -22
  99. manim/scene/vector_space_scene.py +223 -129
  100. manim/scene/zoomed_scene.py +46 -41
  101. manim/typing.py +990 -0
  102. manim/utils/bezier.py +1823 -371
  103. manim/utils/caching.py +12 -5
  104. manim/utils/color/AS2700.py +236 -0
  105. manim/utils/color/BS381.py +318 -0
  106. manim/utils/color/DVIPSNAMES.py +96 -0
  107. manim/utils/color/SVGNAMES.py +179 -0
  108. manim/utils/color/X11.py +533 -0
  109. manim/utils/color/XKCD.py +952 -0
  110. manim/utils/color/__init__.py +61 -0
  111. manim/utils/color/core.py +1667 -0
  112. manim/utils/color/manim_colors.py +218 -0
  113. manim/utils/commands.py +48 -20
  114. manim/utils/config_ops.py +39 -19
  115. manim/utils/debug.py +8 -7
  116. manim/utils/deprecation.py +86 -39
  117. manim/utils/docbuild/__init__.py +17 -0
  118. manim/utils/docbuild/autoaliasattr_directive.py +236 -0
  119. manim/utils/docbuild/autocolor_directive.py +99 -0
  120. manim/utils/docbuild/manim_directive.py +94 -41
  121. manim/utils/docbuild/module_parsing.py +245 -0
  122. manim/utils/exceptions.py +6 -0
  123. manim/utils/family.py +5 -3
  124. manim/utils/family_ops.py +17 -4
  125. manim/utils/file_ops.py +27 -17
  126. manim/utils/hashing.py +55 -45
  127. manim/utils/images.py +13 -7
  128. manim/utils/ipython_magic.py +13 -7
  129. manim/utils/iterables.py +163 -120
  130. manim/utils/module_ops.py +66 -24
  131. manim/utils/opengl.py +77 -24
  132. manim/utils/parameter_parsing.py +32 -0
  133. manim/utils/paths.py +30 -33
  134. manim/utils/polylabel.py +235 -0
  135. manim/utils/qhull.py +218 -0
  136. manim/utils/rate_functions.py +98 -32
  137. manim/utils/simple_functions.py +25 -33
  138. manim/utils/sounds.py +7 -1
  139. manim/utils/space_ops.py +188 -115
  140. manim/utils/testing/__init__.py +17 -0
  141. manim/utils/testing/_frames_testers.py +13 -8
  142. manim/utils/testing/_show_diff.py +5 -3
  143. manim/utils/testing/_test_class_makers.py +34 -18
  144. manim/utils/testing/frames_comparison.py +37 -19
  145. manim/utils/tex.py +130 -198
  146. manim/utils/tex_file_writing.py +77 -47
  147. manim/utils/tex_templates.py +2 -1
  148. manim/utils/unit.py +6 -5
  149. {manim-0.17.0.dist-info → manim-0.19.1.dist-info}/METADATA +64 -65
  150. manim-0.19.1.dist-info/RECORD +220 -0
  151. {manim-0.17.0.dist-info → manim-0.19.1.dist-info}/WHEEL +1 -1
  152. manim-0.19.1.dist-info/entry_points.txt +3 -0
  153. {manim-0.17.0.dist-info → manim-0.19.1.dist-info/licenses}/LICENSE.community +1 -1
  154. manim/cli/new/group.py +0 -189
  155. manim/communitycolors.py +0 -9
  156. manim/gui/__init__.py +0 -0
  157. manim/gui/gui.py +0 -82
  158. manim/plugins/import_plugins.py +0 -43
  159. manim/utils/color.py +0 -552
  160. manim-0.17.0.dist-info/RECORD +0 -206
  161. manim-0.17.0.dist-info/entry_points.txt +0 -4
  162. /manim/cli/{new → checkhealth}/__init__.py +0 -0
  163. {manim-0.17.0.dist-info → manim-0.19.1.dist-info/licenses}/LICENSE +0 -0
manim/scene/section.py CHANGED
@@ -8,6 +8,8 @@ from typing import Any
8
8
 
9
9
  from manim import get_video_metadata
10
10
 
11
+ __all__ = ["Section", "DefaultSectionType"]
12
+
11
13
 
12
14
  class DefaultSectionType(str, Enum):
13
15
  """The type of a section can be used for third party applications.
@@ -32,23 +34,23 @@ class DefaultSectionType(str, Enum):
32
34
 
33
35
 
34
36
  class Section:
35
- """A :class:`.Scene` can be segmented into multiple Sections.
37
+ r"""A :class:`.Scene` can be segmented into multiple Sections.
36
38
  Refer to :doc:`the documentation</tutorials/output_and_config>` for more info.
37
39
  It consists of multiple animations.
38
40
 
39
41
  Attributes
40
42
  ----------
41
- type
42
- Can be used by a third party applications to classify different types of sections.
43
- video
44
- Path to video file with animations belonging to section relative to sections directory.
45
- If ``None``, then the section will not be saved.
46
- name
47
- Human readable, non-unique name for this section.
48
- skip_animations
49
- Skip rendering the animations in this section when ``True``.
50
- partial_movie_files
51
- 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.
52
54
 
53
55
  See Also
54
56
  --------
@@ -57,8 +59,10 @@ class Section:
57
59
  :meth:`.OpenGLRenderer.update_skipping_status`
58
60
  """
59
61
 
60
- def __init__(self, type: str, video: str | None, name: str, skip_animations: bool):
61
- self.type = type
62
+ def __init__(
63
+ self, type_: str, video: str | None, name: str, skip_animations: bool
64
+ ) -> None:
65
+ self.type_ = type_
62
66
  # None when not to be saved -> still keeps section alive
63
67
  self.video: str | None = video
64
68
  self.name = name
@@ -92,11 +96,11 @@ class Section:
92
96
  return dict(
93
97
  {
94
98
  "name": self.name,
95
- "type": self.type,
99
+ "type": self.type_,
96
100
  "video": self.video,
97
101
  },
98
102
  **video_metadata,
99
103
  )
100
104
 
101
- def __repr__(self):
105
+ def __repr__(self) -> str:
102
106
  return f"<Section '{self.name}' stored in '{self.video}'>"
@@ -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()
@@ -283,16 +278,15 @@ class ThreeDScene(Scene):
283
278
  frame_center = frame_center.get_center()
284
279
  frame_center = list(frame_center)
285
280
 
281
+ zoom_value = None
282
+ if zoom is not None:
283
+ zoom_value = config.frame_height / (zoom * cam.height)
284
+
286
285
  for value, method in [
287
286
  [theta, "theta"],
288
287
  [phi, "phi"],
289
288
  [gamma, "gamma"],
290
- [
291
- config.frame_height / (zoom * cam.height)
292
- if zoom is not None
293
- else None,
294
- "zoom",
295
- ],
289
+ [zoom_value, "zoom"],
296
290
  [frame_center, "frame_center"],
297
291
  ]:
298
292
  if value is not None:
@@ -329,7 +323,7 @@ class ThreeDScene(Scene):
329
323
  camera_mobjects = self.renderer.camera.get_value_trackers() + [
330
324
  self.renderer.camera._frame_center,
331
325
  ]
332
- if any([cm in moving_mobjects for cm in camera_mobjects]):
326
+ if any(cm in moving_mobjects for cm in camera_mobjects):
333
327
  return self.mobjects
334
328
  return moving_mobjects
335
329
 
@@ -546,7 +540,5 @@ class SpecialThreeDScene(ThreeDScene):
546
540
  return self.default_angled_camera_position
547
541
 
548
542
  def set_camera_to_default_position(self):
549
- """
550
- Sets the camera to its default position.
551
- """
543
+ """Sets the camera to its default position."""
552
544
  self.set_camera_orientation(**self.default_angled_camera_position)