Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Add __all__ module variables (#367)

Leo Torres8b1b30b75853
diff --git a/manim/__init__.py b/manim/__init__.py
index b7170bccd..2ce84f241 100644
--- a/manim/__init__.py
+++ b/manim/__init__.py
@@ -5,10 +5,12 @@
# global config dict is called 'config', just like the module itself. That's
# why we import the module first with a different name, and then the dict.
from . import config as _config
-from .config import config, tempconfig
+from .config import config, file_writer_config, camera_config
from .constants import *
+from .container import *
+
from .animation.animation import *
from .animation.composition import *
from .animation.creation import *
@@ -26,6 +28,7 @@ from .camera.camera import *
from .camera.mapping_camera import *
from .camera.moving_camera import *
from .camera.three_d_camera import *
+from .camera.multi_camera import *
from .mobject.coordinate_systems import *
from .mobject.changing import *
@@ -58,10 +61,10 @@ from .scene.moving_camera_scene import *
from .scene.reconfigurable_scene import *
from .scene.scene import *
from .scene.sample_space_scene import *
-from .scene.graph_scene import *
from .scene.three_d_scene import *
from .scene.vector_space_scene import *
from .scene.zoomed_scene import *
+from .scene.scene_file_writer import *
from .utils.bezier import *
from .utils.color import *
diff --git a/manim/animation/animation.py b/manim/animation/animation.py
index 1bd05dc40..f136d2bcb 100644
--- a/manim/animation/animation.py
+++ b/manim/animation/animation.py
@@ -1,4 +1,9 @@
"""Animate mobjects."""
+
+
+__all__ = ["Animation"]
+
+
from copy import deepcopy
import numpy as np
diff --git a/manim/animation/composition.py b/manim/animation/composition.py
index 942091a5f..21ef0845e 100644
--- a/manim/animation/composition.py
+++ b/manim/animation/composition.py
@@ -9,6 +9,8 @@ from ..utils.config_ops import digest_config
from ..utils.iterables import remove_list_redundancies
from ..utils.rate_functions import linear
+__all__ = ["AnimationGroup", "Succession", "LaggedStart", "LaggedStartMap"]
+
DEFAULT_LAGGED_START_LAG_RATIO = 0.05
diff --git a/manim/animation/creation.py b/manim/animation/creation.py
index 22e8f3a5e..ef67b0eb9 100644
--- a/manim/animation/creation.py
+++ b/manim/animation/creation.py
@@ -1,4 +1,19 @@
"""Animate the display or removal of a mobject from a scene."""
+
+
+__all__ = [
+ "ShowPartial",
+ "ShowCreation",
+ "Uncreate",
+ "DrawBorderThenFill",
+ "Write",
+ "ShowIncreasingSubsets",
+ "AddTextLetterByLetter",
+ "ShowSubmobjectsOneByOne",
+ "AddTextWordByWord",
+]
+
+
from ..animation.animation import Animation
from ..animation.composition import Succession
from ..mobject.types.vectorized_mobject import VMobject
@@ -132,7 +147,7 @@ class ShowIncreasingSubsets(Animation):
class AddTextLetterByLetter(ShowIncreasingSubsets):
"""
- Add a Text Object letter by letter on the scene. Use time_per_char to change frequency of appearance of the letters.
+ Add a Text Object letter by letter on the scene. Use time_per_char to change frequency of appearance of the letters.
"""
CONFIG = {
diff --git a/manim/animation/fading.py b/manim/animation/fading.py
index 59e09134c..362f01f31 100644
--- a/manim/animation/fading.py
+++ b/manim/animation/fading.py
@@ -1,4 +1,21 @@
"""Fading in and out of view."""
+
+
+__all__ = [
+ "FadeOut",
+ "FadeIn",
+ "FadeInFrom",
+ "FadeInFromDown",
+ "FadeOutAndShift",
+ "FadeOutAndShiftDown",
+ "FadeInFromPoint",
+ "FadeInFromLarge",
+ "VFadeIn",
+ "VFadeOut",
+ "VFadeInThenOut",
+]
+
+
from ..animation.animation import Animation
from ..animation.animation import DEFAULT_ANIMATION_LAG_RATIO
from ..animation.transform import Transform
diff --git a/manim/animation/growing.py b/manim/animation/growing.py
index fe3c9249f..8b7919019 100644
--- a/manim/animation/growing.py
+++ b/manim/animation/growing.py
@@ -1,6 +1,13 @@
-from ..animation.transform import Transform
+__all__ = [
+ "GrowFromPoint",
+ "GrowFromCenter",
+ "GrowFromEdge",
+ "GrowArrow",
+ "SpinInFromNothing",
+]
+
-# from ..utils.paths import counterclockwise_path
+from ..animation.transform import Transform
from ..constants import PI
diff --git a/manim/animation/indication.py b/manim/animation/indication.py
index fd6710c1b..1cf3e1bfb 100644
--- a/manim/animation/indication.py
+++ b/manim/animation/indication.py
@@ -1,3 +1,21 @@
+__all__ = [
+ "FocusOn",
+ "Indicate",
+ "Flash",
+ "CircleIndicate",
+ "ShowPassingFlash",
+ "ShowCreationThenDestruction",
+ "ShowCreationThenFadeOut",
+ "AnimationOnSurroundingRectangle",
+ "ShowPassingFlashAround",
+ "ShowCreationThenDestructionAround",
+ "ShowCreationThenFadeAround",
+ "ApplyWave",
+ "WiggleOutThenIn",
+ "TurnInsideOut",
+]
+
+
import numpy as np
from ..constants import *
diff --git a/manim/animation/movement.py b/manim/animation/movement.py
index de1dea0f1..571e6e29f 100644
--- a/manim/animation/movement.py
+++ b/manim/animation/movement.py
@@ -1,3 +1,12 @@
+__all__ = [
+ "Homotopy",
+ "SmoothedVectorizedHomotopy",
+ "ComplexHomotopy",
+ "PhaseFlow",
+ "MoveAlongPath",
+]
+
+
from ..animation.animation import Animation
from ..utils.rate_functions import linear
diff --git a/manim/animation/numbers.py b/manim/animation/numbers.py
index 98e6b1f6d..54466232c 100644
--- a/manim/animation/numbers.py
+++ b/manim/animation/numbers.py
@@ -1,3 +1,6 @@
+__all__ = ["ChangingDecimal", "ChangeDecimalToValue"]
+
+
import warnings
from ..animation.animation import Animation
diff --git a/manim/animation/rotation.py b/manim/animation/rotation.py
index f0acba243..39053e17f 100644
--- a/manim/animation/rotation.py
+++ b/manim/animation/rotation.py
@@ -1,3 +1,6 @@
+__all__ = ["Rotating", "Rotate"]
+
+
from ..animation.animation import Animation
from ..animation.transform import Transform
from ..constants import OUT
diff --git a/manim/animation/specialized.py b/manim/animation/specialized.py
index f5fc3fa36..558b4131a 100644
--- a/manim/animation/specialized.py
+++ b/manim/animation/specialized.py
@@ -1,3 +1,6 @@
+__all__ = ["MoveCar", "Broadcast"]
+
+
import operator as op
from ..animation.composition import LaggedStart
diff --git a/manim/animation/transform.py b/manim/animation/transform.py
index 6c01e5690..82e9dc852 100644
--- a/manim/animation/transform.py
+++ b/manim/animation/transform.py
@@ -1,3 +1,26 @@
+__all__ = [
+ "Transform",
+ "ReplacementTransform",
+ "TransformFromCopy",
+ "ClockwiseTransform",
+ "CounterclockwiseTransform",
+ "MoveToTarget",
+ "ApplyMethod",
+ "ApplyPointwiseFunction",
+ "ApplyPointwiseFunctionToCenter",
+ "FadeToColor",
+ "ScaleInPlace",
+ "ShrinkToCenter",
+ "Restore",
+ "ApplyFunction",
+ "ApplyMatrix",
+ "ApplyComplexFunction",
+ "CyclicReplace",
+ "Swap",
+ "TransformAnimations",
+]
+
+
import inspect
import numpy as np
diff --git a/manim/animation/update.py b/manim/animation/update.py
index 4166cc3fb..fdc808950 100644
--- a/manim/animation/update.py
+++ b/manim/animation/update.py
@@ -1,3 +1,6 @@
+__all__ = ["UpdateFromFunc", "UpdateFromAlphaFunc", "MaintainPositionRelativeTo"]
+
+
import operator as op
from ..animation.animation import Animation
diff --git a/manim/camera/camera.py b/manim/camera/camera.py
index 11834c921..75bf48c2f 100644
--- a/manim/camera/camera.py
+++ b/manim/camera/camera.py
@@ -1,4 +1,9 @@
"A Camera converts the mobjects contained in a Scene into an array of pixels"
+
+
+__all__ = ["Camera", "BackgroundColoredVMobjectDisplayer"]
+
+
from functools import reduce
import itertools as it
import operator as op
diff --git a/manim/camera/mapping_camera.py b/manim/camera/mapping_camera.py
index 184f0d8d4..f96d3c92a 100644
--- a/manim/camera/mapping_camera.py
+++ b/manim/camera/mapping_camera.py
@@ -1,3 +1,6 @@
+__all__ = ["MappingCamera", "OldMultiCamera", "SplitScreenCamera"]
+
+
import numpy as np
from ..camera.camera import Camera
diff --git a/manim/camera/moving_camera.py b/manim/camera/moving_camera.py
index 253498c76..53bdadaa9 100644
--- a/manim/camera/moving_camera.py
+++ b/manim/camera/moving_camera.py
@@ -1,3 +1,6 @@
+__all__ = ["CameraFrame", "MovingCamera"]
+
+
from ..camera.camera import Camera
from ..config import config
from ..constants import ORIGIN, WHITE
diff --git a/manim/camera/multi_camera.py b/manim/camera/multi_camera.py
index b78685812..bc5dc2e71 100644
--- a/manim/camera/multi_camera.py
+++ b/manim/camera/multi_camera.py
@@ -1,10 +1,12 @@
+__all__ = ["MultiCamera"]
+
+
from ..camera.moving_camera import MovingCamera
from ..utils.iterables import list_difference_update
class MultiCamera(MovingCamera):
- """Camera Object that allows for multiple perspectives.
- """
+ """Camera Object that allows for multiple perspectives."""
CONFIG = {
"allow_cameras_to_capture_their_own_display": False,
diff --git a/manim/camera/three_d_camera.py b/manim/camera/three_d_camera.py
index 5b4706304..c5dd12c60 100644
--- a/manim/camera/three_d_camera.py
+++ b/manim/camera/three_d_camera.py
@@ -1,3 +1,6 @@
+__all__ = ["ThreeDCamera"]
+
+
import numpy as np
from ..camera.camera import Camera
diff --git a/manim/container.py b/manim/container.py
index a80c92eb2..5182b6858 100644
--- a/manim/container.py
+++ b/manim/container.py
@@ -3,12 +3,14 @@ Abstract base class for several objects used by manim. In particular, both
:class:`~.Scene` and :class:`~.Mobject` inherit from Container.
"""
-from abc import ABC, abstractmethod
-from .utils.config_ops import digest_config
__all__ = ["Container"]
+from abc import ABC, abstractmethod
+from .utils.config_ops import digest_config
+
+
class Container(ABC):
"""Abstract base class for several objects used by manim. In particular, both
:class:`~.Scene` and :class:`~.Mobject` inherit from Container.
diff --git a/manim/mobject/changing.py b/manim/mobject/changing.py
index 02475d629..4dc5a484a 100644
--- a/manim/mobject/changing.py
+++ b/manim/mobject/changing.py
@@ -1,3 +1,6 @@
+__all__ = ["AnimatedBoundary", "TracedPath"]
+
+
from ..constants import *
from ..mobject.types.vectorized_mobject import VMobject
from ..mobject.types.vectorized_mobject import VGroup
diff --git a/manim/mobject/coordinate_systems.py b/manim/mobject/coordinate_systems.py
index 713659f32..e3c89d365 100644
--- a/manim/mobject/coordinate_systems.py
+++ b/manim/mobject/coordinate_systems.py
@@ -1,3 +1,6 @@
+__all__ = ["CoordinateSystem", "Axes", "ThreeDAxes", "NumberPlane", "ComplexPlane"]
+
+
import numpy as np
import numbers
@@ -280,7 +283,7 @@ class NumberPlane(Axes):
def get_lines(self):
"""Generate all the lines, faded and not faded. Two sets of lines are generated: one parallel to the X-axis, and parallel to the Y-axis.
-
+
Returns
-------
Tuple[:class:`~.VGroup`, :class:`~.VGroup`]
@@ -313,9 +316,9 @@ class NumberPlane(Axes):
axis_perpendicular_to : :class:`~.Line`
The axis with which the lines will be perpendicular.
-
+
ratio_faded_lines : :class:`float`
- The number of faded lines between each non-faded line.
+ The number of faded lines between each non-faded line.
freq : :class:`float`
Frequency of non-faded lines (number of non-faded lines per graph unit).
@@ -323,7 +326,7 @@ class NumberPlane(Axes):
Returns
-------
Tuple[:class:`~.VGroup`, :class:`~.VGroup`]
- The first (i.e the non-faded lines parallel to `axis_parallel_to`) and second (i.e the faded lines parallel to `axis_parallel_to`) sets of lines, respectively.
+ The first (i.e the non-faded lines parallel to `axis_parallel_to`) and second (i.e the faded lines parallel to `axis_parallel_to`) sets of lines, respectively.
"""
line = Line(axis_parallel_to.get_start(), axis_parallel_to.get_end())
dense_freq = ratio_faded_lines
diff --git a/manim/mobject/frame.py b/manim/mobject/frame.py
index 1c4b6e41b..d2a8ccd0c 100644
--- a/manim/mobject/frame.py
+++ b/manim/mobject/frame.py
@@ -1,3 +1,11 @@
+__all__ = [
+ "ScreenRectangle",
+ "FullScreenRectangle",
+ "FullScreenFadeRectangle",
+ "PictureInPictureFrame",
+]
+
+
from ..constants import *
from ..config import config
from ..mobject.geometry import Rectangle
diff --git a/manim/mobject/functions.py b/manim/mobject/functions.py
index f12ec3767..68a5ebbee 100644
--- a/manim/mobject/functions.py
+++ b/manim/mobject/functions.py
@@ -1,3 +1,6 @@
+__all__ = ["ParametricFunction", "FunctionGraph"]
+
+
from ..constants import *
from ..config import config
from ..mobject.types.vectorized_mobject import VMobject
diff --git a/manim/mobject/geometry.py b/manim/mobject/geometry.py
index b8d2ae253..7c30ebcbe 100644
--- a/manim/mobject/geometry.py
+++ b/manim/mobject/geometry.py
@@ -1,4 +1,37 @@
"""Mobjects that are simple geometric shapes."""
+
+
+__all__ = [
+ "TipableVMobject",
+ "Arc",
+ "ArcBetweenPoints",
+ "CurvedArrow",
+ "CurvedDoubleArrow",
+ "Circle",
+ "Dot",
+ "SmallDot",
+ "Ellipse",
+ "AnnularSector",
+ "Sector",
+ "Annulus",
+ "Line",
+ "DashedLine",
+ "TangentLine",
+ "Elbow",
+ "Arrow",
+ "Vector",
+ "DoubleArrow",
+ "CubicBezier",
+ "Polygon",
+ "RegularPolygon",
+ "Triangle",
+ "ArrowTip",
+ "Rectangle",
+ "Square",
+ "RoundedRectangle",
+]
+
+
import warnings
import numpy as np
import math
diff --git a/manim/mobject/matrix.py b/manim/mobject/matrix.py
index 4d132e46e..30e7db90e 100644
--- a/manim/mobject/matrix.py
+++ b/manim/mobject/matrix.py
@@ -1,3 +1,15 @@
+__all__ = [
+ "Matrix",
+ "DecimalMatrix",
+ "IntegerMatrix",
+ "MobjectMatrix",
+ "matrix_to_tex_string",
+ "matrix_to_mobject",
+ "vector_coordinate_label",
+ "get_det_text",
+]
+
+
import numpy as np
from ..constants import *
@@ -122,7 +134,7 @@ class Matrix(VMobject):
def get_rows(self):
"""Return rows of the matrix as VGroups
-
+
Returns
--------
List[:class:`~.VGroup`]
@@ -134,12 +146,12 @@ class Matrix(VMobject):
def set_row_colors(self, *colors):
"""Set individual colors for each row of the matrix
-
+
Parameters
----------
colors : :class:`str`
The list of colors; each color specified corresponds to a row.
-
+
Returns
-------
:class:`Matrix`
diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py
index 92a3de571..66f429263 100644
--- a/manim/mobject/mobject.py
+++ b/manim/mobject/mobject.py
@@ -1,4 +1,9 @@
"""Base classes for objects that can be displayed."""
+
+
+__all__ = ["Mobject", "Group"]
+
+
from functools import reduce
import copy
import itertools as it
diff --git a/manim/mobject/mobject_update_utils.py b/manim/mobject/mobject_update_utils.py
index ef40a8773..f43e69d94 100644
--- a/manim/mobject/mobject_update_utils.py
+++ b/manim/mobject/mobject_update_utils.py
@@ -1,3 +1,15 @@
+__all__ = [
+ "assert_is_mobject_method",
+ "always",
+ "f_always",
+ "always_redraw",
+ "always_shift",
+ "always_rotate",
+ "turn_animation_into_updater",
+ "cycle_animation",
+]
+
+
import inspect
import numpy as np
diff --git a/manim/mobject/number_line.py b/manim/mobject/number_line.py
index e2e6ff963..0d827df26 100644
--- a/manim/mobject/number_line.py
+++ b/manim/mobject/number_line.py
@@ -1,4 +1,9 @@
"""Mobject representing a number line."""
+
+
+__all__ = ["NumberLine", "UnitInterval"]
+
+
import operator as op
from ..constants import *
diff --git a/manim/mobject/numbers.py b/manim/mobject/numbers.py
index 6c5caf3ac..79335c4f7 100644
--- a/manim/mobject/numbers.py
+++ b/manim/mobject/numbers.py
@@ -1,3 +1,6 @@
+__all__ = ["DecimalNumber", "Integer"]
+
+
from ..constants import *
from ..mobject.svg.tex_mobject import SingleStringTexMobject
from ..mobject.types.vectorized_mobject import VMobject
diff --git a/manim/mobject/probability.py b/manim/mobject/probability.py
index a9fd5658d..2a7ce7597 100644
--- a/manim/mobject/probability.py
+++ b/manim/mobject/probability.py
@@ -1,3 +1,6 @@
+__all__ = ["SampleSpace", "BarChart"]
+
+
from ..constants import *
from ..mobject.geometry import Line
from ..mobject.geometry import Rectangle
diff --git a/manim/mobject/shape_matchers.py b/manim/mobject/shape_matchers.py
index 00b8c54a4..378201055 100644
--- a/manim/mobject/shape_matchers.py
+++ b/manim/mobject/shape_matchers.py
@@ -1,3 +1,6 @@
+__all__ = ["SurroundingRectangle", "BackgroundRectangle", "Cross", "Underline"]
+
+
from ..constants import *
from ..mobject.geometry import Line
from ..mobject.geometry import Rectangle
diff --git a/manim/mobject/svg/brace.py b/manim/mobject/svg/brace.py
index e16e1d7c9..47c742293 100644
--- a/manim/mobject/svg/brace.py
+++ b/manim/mobject/svg/brace.py
@@ -1,3 +1,6 @@
+__all__ = ["Brace", "BraceLabel", "BraceText"]
+
+
import numpy as np
from ...animation.composition import AnimationGroup
diff --git a/manim/mobject/svg/code_mobject.py b/manim/mobject/svg/code_mobject.py
index 0ae7c415e..86ba413de 100644
--- a/manim/mobject/svg/code_mobject.py
+++ b/manim/mobject/svg/code_mobject.py
@@ -1,3 +1,30 @@
+"""
+1) Code is VGroup() with three things
+ 1.1) Code[0] is Code.background_mobject
+ which can be a
+ 1.1.1) Rectangle() if background == "rectangle"
+ 1.1.2) VGroup() of Rectangle() and Dot() for three buttons if background == "window"
+ 1.2) Code[1] is Code.line_numbers Which is a Paragraph() object, this mean you can use
+ Code.line_numbers[0] or Code[1][0] to access first line number
+ 1.3) Code[2] is Code.code
+ 1.3.1) Which is a Paragraph() with color highlighted, this mean you can use
+ Code.code[1] or Code[2][1]
+ line number 1
+ Code.code[1][0] or Code.code[1][0]
+ first character of line number 1
+ Code.code[1][0:5] or Code.code[1][0:5]
+ first five characters of line number 1
+"""
+
+
+__all__ = [
+ "Code",
+ "hilite_me",
+ "get_default_style",
+ "insert_line_numbers",
+]
+
+
import html
import os
from ...constants import *
@@ -12,24 +39,6 @@ from pygments import highlight
from pygments.lexers import get_lexer_by_name
from pygments.formatters.html import HtmlFormatter
-"""
-1) Code is VGroup() with three things
- 1.1) Code[0] is Code.background_mobject
- which can be a
- 1.1.1) Rectangle() if background == "rectangle"
- 1.1.2) VGroup() of Rectangle() and Dot() for three buttons if background == "window"
- 1.2) Code[1] is Code.line_numbers Which is a Paragraph() object, this mean you can use
- Code.line_numbers[0] or Code[1][0] to access first line number
- 1.3) Code[2] is Code.code
- 1.3.1) Which is a Paragraph() with color highlighted, this mean you can use
- Code.code[1] or Code[2][1]
- line number 1
- Code.code[1][0] or Code.code[1][0]
- first character of line number 1
- Code.code[1][0:5] or Code.code[1][0:5]
- first five characters of line number 1
-"""
-
class Code(VGroup):
CONFIG = {
diff --git a/manim/mobject/svg/drawings.py b/manim/mobject/svg/drawings.py
index 67dd69465..95614fddb 100644
--- a/manim/mobject/svg/drawings.py
+++ b/manim/mobject/svg/drawings.py
@@ -1,3 +1,30 @@
+__all__ = [
+ "Lightbulb",
+ "BitcoinLogo",
+ "Guitar",
+ "Speedometer",
+ "AoPSLogo",
+ "PartyHat",
+ "Laptop",
+ "PatreonLogo",
+ "VideoIcon",
+ "VideoSeries",
+ "Headphones",
+ "Clock",
+ "ClockPassesTime",
+ "Bubble",
+ "SpeechBubble",
+ "DoubleSpeechBubble",
+ "ThoughtBubble",
+ "Car",
+ "VectorizedEarth",
+ "Logo",
+ "DeckOfCards",
+ "PlayingCard",
+ "SuitSymbol",
+]
+
+
import itertools as it
import string
diff --git a/manim/mobject/svg/svg_mobject.py b/manim/mobject/svg/svg_mobject.py
index d78d8ac42..247c03215 100644
--- a/manim/mobject/svg/svg_mobject.py
+++ b/manim/mobject/svg/svg_mobject.py
@@ -1,4 +1,9 @@
"""Mobjects generated from an SVG file."""
+
+
+__all__ = ["SVGMobject", "VMobjectFromSVGPathstring", "string_to_numbers"]
+
+
import itertools as it
import re
import os
diff --git a/manim/mobject/svg/tex_mobject.py b/manim/mobject/svg/tex_mobject.py
index 9b14e8819..9f6afa315 100644
--- a/manim/mobject/svg/tex_mobject.py
+++ b/manim/mobject/svg/tex_mobject.py
@@ -1,3 +1,14 @@
+__all__ = [
+ "TexSymbol",
+ "SingleStringTexMobject",
+ "TexMobject",
+ "TextMobject",
+ "BulletedList",
+ "TexMobjectFromPresetString",
+ "Title",
+]
+
+
from functools import reduce
import operator as op
diff --git a/manim/mobject/svg/text_mobject.py b/manim/mobject/svg/text_mobject.py
index 8272a3943..6edfca975 100644
--- a/manim/mobject/svg/text_mobject.py
+++ b/manim/mobject/svg/text_mobject.py
@@ -1,3 +1,6 @@
+__all__ = ["TextSetting", "Text", "TextWithFixHeight", "Paragraph"]
+
+
import re
import os
import copy
diff --git a/manim/mobject/three_d_utils.py b/manim/mobject/three_d_utils.py
index bf02d3321..5acc8f4bd 100644
--- a/manim/mobject/three_d_utils.py
+++ b/manim/mobject/three_d_utils.py
@@ -1,3 +1,15 @@
+__all__ = [
+ "get_3d_vmob_gradient_start_and_end_points",
+ "get_3d_vmob_start_corner_index",
+ "get_3d_vmob_end_corner_index",
+ "get_3d_vmob_start_corner",
+ "get_3d_vmob_end_corner",
+ "get_3d_vmob_unit_normal",
+ "get_3d_vmob_start_corner_unit_normal",
+ "get_3d_vmob_end_corner_unit_normal",
+]
+
+
import numpy as np
from ..constants import ORIGIN
diff --git a/manim/mobject/three_dimensions.py b/manim/mobject/three_dimensions.py
index 4f1194dd4..54cb6a06d 100644
--- a/manim/mobject/three_dimensions.py
+++ b/manim/mobject/three_dimensions.py
@@ -1,3 +1,6 @@
+__all__ = ["ThreeDVMobject", "ParametricSurface", "Sphere", "Cube", "Prism"]
+
+
from ..constants import *
from ..mobject.geometry import Square
from ..mobject.types.vectorized_mobject import VGroup
diff --git a/manim/mobject/types/image_mobject.py b/manim/mobject/types/image_mobject.py
index f50f76352..25badc257 100644
--- a/manim/mobject/types/image_mobject.py
+++ b/manim/mobject/types/image_mobject.py
@@ -1,3 +1,6 @@
+__all__ = ["AbstractImageMobject", "ImageMobject", "ImageMobjectFromCamera"]
+
+
import numpy as np
from PIL import Image
diff --git a/manim/mobject/types/point_cloud_mobject.py b/manim/mobject/types/point_cloud_mobject.py
index c0bd8a199..838908a84 100644
--- a/manim/mobject/types/point_cloud_mobject.py
+++ b/manim/mobject/types/point_cloud_mobject.py
@@ -1,3 +1,6 @@
+__all__ = ["PMobject", "Mobject1D", "Mobject2D", "PGroup", "PointCloudDot", "Point"]
+
+
from ...constants import *
from ...mobject.mobject import Mobject
from ...utils.bezier import interpolate
diff --git a/manim/mobject/types/vectorized_mobject.py b/manim/mobject/types/vectorized_mobject.py
index 864da5210..1d93ee57c 100644
--- a/manim/mobject/types/vectorized_mobject.py
+++ b/manim/mobject/types/vectorized_mobject.py
@@ -1,4 +1,16 @@
"""Mobjects that use vector graphics."""
+
+
+__all__ = [
+ "VMobject",
+ "VGroup",
+ "VDict",
+ "VectorizedPoint",
+ "CurvesAsSubmobjects",
+ "DashedVMobject",
+]
+
+
import itertools as it
import sys
@@ -881,7 +893,7 @@ class VDict(VMobject):
mapping_or_iterable : Union[:class:`Mapping`, Iterable[Tuple[Hashable, :class:`~.VMobject`]]], optional
The parameter specifying the key-value mapping of keys and mobjects.
show_keys : :class:`bool`, optional
- Whether to also display the key associated with
+ Whether to also display the key associated with
the mobject. This might be useful when debugging,
especially when there are a lot of mobjects in the
:class:`VDict`. Defaults to False.
@@ -891,7 +903,7 @@ class VDict(VMobject):
Attributes
----------
show_keys : :class:`bool`
- Whether to also display the key associated with
+ Whether to also display the key associated with
the mobject. This might be useful when debugging,
especially when there are a lot of mobjects in the
:class:`VDict`. When displayed, the key is towards
@@ -937,7 +949,7 @@ class VDict(VMobject):
def remove(self, key):
"""Removes the mobject from the :class:`VDict` object having the key `key`
-
+
Also, it internally removes the mobject from the `submobjects` :class:`list`
of :class:`~.Mobject`, (which is responsible for removing it from the screen)
@@ -964,12 +976,12 @@ class VDict(VMobject):
def __getitem__(self, key):
"""Overriding the [] operator for getting submobject by key
-
+
Parameters
----------
key : Hashable
The key of the submoject to be accessed
-
+
Returns
-------
:class:`VMobject`
@@ -992,7 +1004,7 @@ class VDict(VMobject):
The key of the submoject to be assigned
value : :class:`VMobject`
The submobject to bind the key to
-
+
Returns
-------
None
@@ -1009,7 +1021,7 @@ class VDict(VMobject):
def get_all_submobjects(self):
"""To get all the submobjects associated with a particular :class:`VDict` object
-
+
Returns
-------
:class:`dict_values`
diff --git a/manim/mobject/value_tracker.py b/manim/mobject/value_tracker.py
index c08d02925..f680657a4 100644
--- a/manim/mobject/value_tracker.py
+++ b/manim/mobject/value_tracker.py
@@ -1,3 +1,6 @@
+__all__ = ["ValueTracker", "ExponentialValueTracker", "ComplexValueTracker"]
+
+
import numpy as np
from ..utils.paths import straight_path
diff --git a/manim/mobject/vector_field.py b/manim/mobject/vector_field.py
index ad5310a72..48971ec71 100644
--- a/manim/mobject/vector_field.py
+++ b/manim/mobject/vector_field.py
@@ -1,3 +1,17 @@
+__all__ = [
+ "VectorField",
+ "StreamLines",
+ "ShowPassingFlashWithThinningStrokeWidth",
+ "AnimatedStreamLines",
+ "get_colored_background_image",
+ "get_rgb_gradient_function",
+ "get_color_field_image_file",
+ "move_along_vector_field",
+ "move_submobjects_along_vector_field",
+ "move_points_along_vector_field",
+]
+
+
import numpy as np
import os
import itertools as it
diff --git a/manim/scene/graph_scene.py b/manim/scene/graph_scene.py
index 2d8a4d0e0..67fd95daf 100644
--- a/manim/scene/graph_scene.py
+++ b/manim/scene/graph_scene.py
@@ -1,3 +1,5 @@
+__all__ = ["GraphScene"]
+
import itertools as it
from ..config import config
diff --git a/manim/scene/moving_camera_scene.py b/manim/scene/moving_camera_scene.py
index 0cbfb06d5..05adc5ae8 100644
--- a/manim/scene/moving_camera_scene.py
+++ b/manim/scene/moving_camera_scene.py
@@ -1,3 +1,5 @@
+__all__ = ["MovingCameraScene"]
+
from ..camera.moving_camera import MovingCamera
from ..scene.scene import Scene
from ..utils.iterables import list_update
diff --git a/manim/scene/reconfigurable_scene.py b/manim/scene/reconfigurable_scene.py
index 082b9bddf..7f5d3c21d 100644
--- a/manim/scene/reconfigurable_scene.py
+++ b/manim/scene/reconfigurable_scene.py
@@ -1,3 +1,5 @@
+__all__ = ["ReconfigurableScene"]
+
from ..animation.transform import Transform
from ..constants import *
from ..mobject.mobject import Mobject
diff --git a/manim/scene/sample_space_scene.py b/manim/scene/sample_space_scene.py
index f8abf32fd..f2c5e61bc 100644
--- a/manim/scene/sample_space_scene.py
+++ b/manim/scene/sample_space_scene.py
@@ -1,3 +1,6 @@
+__all__ = ["SampleSpaceScene"]
+
+
from ..animation.animation import Animation
from ..animation.transform import MoveToTarget
from ..animation.transform import Transform
diff --git a/manim/scene/scene.py b/manim/scene/scene.py
index 217988b28..d3ad0f329 100644
--- a/manim/scene/scene.py
+++ b/manim/scene/scene.py
@@ -1,4 +1,9 @@
"""A Scene is the canvas of the animation."""
+
+
+__all__ = ["Scene", "EndSceneEarlyException"]
+
+
import inspect
import random
import warnings
diff --git a/manim/scene/scene_file_writer.py b/manim/scene/scene_file_writer.py
index bd5342b66..6f835fbbb 100644
--- a/manim/scene/scene_file_writer.py
+++ b/manim/scene/scene_file_writer.py
@@ -1,3 +1,6 @@
+__all__ = ["SceneFileWriter"]
+
+
import numpy as np
from pydub import AudioSegment
import shutil
diff --git a/manim/scene/three_d_scene.py b/manim/scene/three_d_scene.py
index 0da81db6a..8b83f7cd7 100644
--- a/manim/scene/three_d_scene.py
+++ b/manim/scene/three_d_scene.py
@@ -1,3 +1,6 @@
+__all__ = ["ThreeDScene", "SpecialThreeDScene"]
+
+
from ..animation.transform import ApplyMethod
from ..camera.three_d_camera import ThreeDCamera
from ..constants import DEGREES
diff --git a/manim/scene/vector_space_scene.py b/manim/scene/vector_space_scene.py
index b285fcc7c..5f833deee 100644
--- a/manim/scene/vector_space_scene.py
+++ b/manim/scene/vector_space_scene.py
@@ -1,3 +1,6 @@
+__all__ = ["VectorScene", "LinearTransformationScene"]
+
+
import numpy as np
from ..animation.animation import Animation
diff --git a/manim/scene/zoomed_scene.py b/manim/scene/zoomed_scene.py
index f2060978d..27205c8c1 100644
--- a/manim/scene/zoomed_scene.py
+++ b/manim/scene/zoomed_scene.py
@@ -1,3 +1,6 @@
+__all__ = ["ZoomedScene"]
+
+
from ..animation.transform import ApplyMethod
from ..camera.moving_camera import MovingCamera
from ..camera.multi_camera import MultiCamera
diff --git a/manim/utils/bezier.py b/manim/utils/bezier.py
index c86eab566..d9944f783 100644
--- a/manim/utils/bezier.py
+++ b/manim/utils/bezier.py
@@ -1,3 +1,17 @@
+__all__ = [
+ "bezier",
+ "partial_bezier_points",
+ "interpolate",
+ "integer_interpolate",
+ "mid",
+ "inverse_interpolate",
+ "match_interpolate",
+ "get_smooth_handle_points",
+ "diag_to_matrix",
+ "is_closed",
+]
+
+
from scipy import linalg
import numpy as np
diff --git a/manim/utils/color.py b/manim/utils/color.py
index ebae3ddac..271d48372 100644
--- a/manim/utils/color.py
+++ b/manim/utils/color.py
@@ -1,3 +1,22 @@
+__all__ = [
+ "color_to_rgb",
+ "color_to_rgba",
+ "rgb_to_color",
+ "rgba_to_color",
+ "rgb_to_hex",
+ "hex_to_rgb",
+ "invert_color",
+ "color_to_int_rgb",
+ "color_to_int_rgba",
+ "color_gradient",
+ "interpolate_color",
+ "average_color",
+ "random_bright_color",
+ "random_color",
+ "get_shaded_rgb",
+]
+
+
import random
from colour import Color
diff --git a/manim/utils/config_ops.py b/manim/utils/config_ops.py
index ebbf9b9b5..4ffb46ea4 100644
--- a/manim/utils/config_ops.py
+++ b/manim/utils/config_ops.py
@@ -1,3 +1,14 @@
+__all__ = [
+ "get_all_descendent_classes",
+ "filtered_locals",
+ "digest_config",
+ "merge_dicts_recursively",
+ "soft_dict_update",
+ "digest_locals",
+ "DictAsObject",
+]
+
+
import inspect
import itertools as it
diff --git a/manim/utils/debug.py b/manim/utils/debug.py
index e6bfec433..3e615d597 100644
--- a/manim/utils/debug.py
+++ b/manim/utils/debug.py
@@ -1,3 +1,6 @@
+__all__ = ["print_family", "get_submobject_index_labels"]
+
+
from ..constants import BLACK
from ..mobject.numbers import Integer
from ..mobject.types.vectorized_mobject import VGroup
diff --git a/manim/utils/file_ops.py b/manim/utils/file_ops.py
index b0b9069d3..44e359ed7 100644
--- a/manim/utils/file_ops.py
+++ b/manim/utils/file_ops.py
@@ -1,3 +1,12 @@
+__all__ = [
+ "add_extension_if_not_present",
+ "guarantee_existence",
+ "seek_full_path_from_defaults",
+ "modify_atime",
+ "open_file",
+]
+
+
import os
import subprocess as sp
import platform
@@ -32,12 +41,12 @@ def seek_full_path_from_defaults(file_name, default_dir, extensions):
def modify_atime(file_path):
- """Will manually change the accessed time (called `atime`) of the file, as on a lot of OS the accessed time refresh is disabled by default.
+ """Will manually change the accessed time (called `atime`) of the file, as on a lot of OS the accessed time refresh is disabled by default.
Parameters
----------
file_path : :class:`str`
- The path of the file.
+ The path of the file.
"""
os.utime(file_path, times=(time.time(), os.path.getmtime(file_path)))
diff --git a/manim/utils/hashing.py b/manim/utils/hashing.py
index 563dd330e..454b9b206 100644
--- a/manim/utils/hashing.py
+++ b/manim/utils/hashing.py
@@ -13,11 +13,11 @@ class CustomEncoder(json.JSONEncoder):
def default(self, obj):
"""
This method is used to serialize objects to JSON format.
-
+
If obj is a function, then it will return a dict with two keys : 'code', for the code source, and 'nonlocals' for all nonlocalsvalues. (including nonlocals functions, that will be serialized as this is recursive.)
if obj is a np.darray, it converts it into a list.
if obj is an object with __dict__ attribute, it returns its __dict__.
- Else, will let the JSONEncoder do the stuff, and throw an error if the type is not suitable for JSONEncoder.
+ Else, will let the JSONEncoder do the stuff, and throw an error if the type is not suitable for JSONEncoder.
Parameters
----------
@@ -61,7 +61,7 @@ class CustomEncoder(json.JSONEncoder):
----------
obj : Any
The obj to be cleaned.
-
+
Returns
-------
Any
@@ -92,7 +92,7 @@ def get_json(obj):
Returns
-------
- :class:`str`
+ :class:`str`
The flattened object
"""
return json.dumps(obj, cls=CustomEncoder)
@@ -136,7 +136,7 @@ def get_hash_from_play_call(camera_object, animations_list, current_mobjects_lis
Returns
-------
- :class:`str`
+ :class:`str`
A string concatenation of the respective hashes of `camera_object`, `animations_list` and `current_mobjects_list`, separated by `_`.
"""
camera_json = get_json(get_camera_dict_for_hashing(camera_object))
diff --git a/manim/utils/images.py b/manim/utils/images.py
index 6359d58d4..0e60e1dbf 100644
--- a/manim/utils/images.py
+++ b/manim/utils/images.py
@@ -1,3 +1,6 @@
+__all__ = ["get_full_raster_image_path", "drag_pixels", "invert_image"]
+
+
import numpy as np
import os
diff --git a/manim/utils/iterables.py b/manim/utils/iterables.py
index 51995f688..08c81f0d5 100644
--- a/manim/utils/iterables.py
+++ b/manim/utils/iterables.py
@@ -1,3 +1,19 @@
+__all__ = [
+ "remove_list_redundancies",
+ "list_update",
+ "list_difference_update",
+ "all_elements_are_instances",
+ "adjacent_n_tuples",
+ "adjacent_pairs",
+ "tuplify",
+ "stretch_array_to_length",
+ "make_even",
+ "make_even_by_cycling",
+ "remove_nones",
+ "concatenate_lists",
+]
+
+
import itertools as it
import numpy as np
diff --git a/manim/utils/paths.py b/manim/utils/paths.py
index 861e6095b..d71daeb3d 100644
--- a/manim/utils/paths.py
+++ b/manim/utils/paths.py
@@ -1,3 +1,11 @@
+__all__ = [
+ "straight_path",
+ "path_along_arc",
+ "clockwise_path",
+ "counterclockwise_path",
+]
+
+
import numpy as np
from ..constants import OUT
diff --git a/manim/utils/rate_functions.py b/manim/utils/rate_functions.py
index 1dc0f4d78..1bb741ed6 100644
--- a/manim/utils/rate_functions.py
+++ b/manim/utils/rate_functions.py
@@ -1,3 +1,21 @@
+__all__ = [
+ "linear",
+ "smooth",
+ "rush_into",
+ "rush_from",
+ "slow_into",
+ "double_smooth",
+ "there_and_back",
+ "there_and_back_with_pause",
+ "running_start",
+ "not_quite_there",
+ "wiggle",
+ "squish_rate_func",
+ "lingering",
+ "exponential_decay",
+]
+
+
import numpy as np
from ..utils.bezier import bezier
diff --git a/manim/utils/simple_functions.py b/manim/utils/simple_functions.py
index 20329e374..dfd5583b3 100644
--- a/manim/utils/simple_functions.py
+++ b/manim/utils/simple_functions.py
@@ -1,3 +1,15 @@
+__all__ = [
+ "sigmoid",
+ "choose_using_cache",
+ "choose",
+ "get_num_args",
+ "get_parameters",
+ "clip_in_place",
+ "fdiv",
+ "binary_search",
+]
+
+
from functools import reduce
import inspect
import numpy as np
diff --git a/manim/utils/sounds.py b/manim/utils/sounds.py
index d98ffcf3d..0f30ca949 100644
--- a/manim/utils/sounds.py
+++ b/manim/utils/sounds.py
@@ -1,3 +1,11 @@
+__all__ = [
+ "play_chord",
+ "play_error_sound",
+ "play_finish_sound",
+ "get_full_sound_file_path",
+]
+
+
import os
from ..utils.file_ops import seek_full_path_from_defaults
diff --git a/manim/utils/space_ops.py b/manim/utils/space_ops.py
index e56dfa3b0..6569de264 100644
--- a/manim/utils/space_ops.py
+++ b/manim/utils/space_ops.py
@@ -1,3 +1,32 @@
+__all__ = [
+ "get_norm",
+ "quaternion_mult",
+ "quaternion_from_angle_axis",
+ "angle_axis_from_quaternion",
+ "quaternion_conjugate",
+ "rotate_vector",
+ "thick_diagonal",
+ "rotation_matrix",
+ "rotation_about_z",
+ "z_to_vector",
+ "angle_between",
+ "angle_of_vector",
+ "angle_between_vectors",
+ "project_along_vector",
+ "normalize",
+ "cross",
+ "get_unit_normal",
+ "compass_directions",
+ "complex_to_R3",
+ "R3_to_complex",
+ "complex_func_to_R3_func",
+ "center_of_mass",
+ "midpoint",
+ "line_intersection",
+ "get_winding_number",
+]
+
+
from functools import reduce
import numpy as np
diff --git a/manim/utils/strings.py b/manim/utils/strings.py
index e32b6120e..07a0cd79b 100644
--- a/manim/utils/strings.py
+++ b/manim/utils/strings.py
@@ -1,3 +1,13 @@
+__all__ = [
+ "to_camel_case",
+ "initials",
+ "camel_case_initials",
+ "complex_string",
+ "split_string_to_isolate_substrings",
+ "split_string_list_to_isolate_substrings",
+]
+
+
import itertools as it
import re
import string
diff --git a/manim/utils/tex.py b/manim/utils/tex.py
index 0c4217644..a4f72b32f 100644
--- a/manim/utils/tex.py
+++ b/manim/utils/tex.py
@@ -1,3 +1,6 @@
+__all__ = ["TexTemplateFromFile", "TexTemplate"]
+
+
import os
from ..utils.config_ops import digest_config