A community-maintained Python framework for creating mathematical animations.
Changed current DocStrings to Numpy Format.
Aathish Sivasubrahmanian04f56c76cdd5
diff --git a/manimlib/scene/graph_scene.py b/manimlib/scene/graph_scene.pyindex 03550e390..77dd66bbd 100644--- a/manimlib/scene/graph_scene.py+++ b/manimlib/scene/graph_scene.py@@ -71,7 +71,7 @@ class GraphScene(Scene):Parameters----------- animate (bool=False)+ animate : bool, optionalWhether or not to animate the setting up of the Axes."""# TODO, once eoc is done, refactor this to be less redundant.@@ -156,12 +156,12 @@ class GraphScene(Scene):Parameters----------- x : (int,float)+ x : int, floatThe x value- y : (int,float)+ y : int, floatThe y value-+Returns-------np.ndarray@@ -184,9 +184,9 @@ class GraphScene(Scene):Parameters----------- point (np.ndarray)+ point : np.ndarrayThe point on the graph.-+Returns-------tuple@@ -210,17 +210,17 @@ class GraphScene(Scene):func : functionThe function to plot. It's return value should bethe y-coordinate for a given x-coordinate-- color : str++ color : str, optionalThe string of the RGB color of the curve. in Hexadecimal representation.-- x_min : (Union[int,float])++ x_min : int, float, optionalThe lower x_value from which to plot the curve.-- x_max : (Union[int,float])++ x_max : int, float, optionalThe higher x_value until which to plot the curve.-- **kwargs:++ **kwargs :Any valid keyword arguments of ParametricFunction.Return@@ -259,13 +259,13 @@ class GraphScene(Scene):Parameters----------- x (Union[int, float])+ x : int, floatThe x value for which to find the y value.-- graph ParametricFunction++ graph : ParametricFunctionThe ParametricFunction object on whichthe x and y value lie.-+Returns-------numpy.nparray@@ -280,16 +280,16 @@ class GraphScene(Scene):Parameters----------- x (Union[int, float])+ x : int, floatThe x value at which the tangent must touch the curve.-- graph ParametricFunction++ graph : ParametricFunctionThe ParametricFunction for which to calculate the tangent.-- dx (Union(float, int =0.01))++ dx : int, float, optionalThe small change in x with which a small change in ywill be compared in order to obtain the tangent.-+Returns-------float@@ -301,21 +301,21 @@ class GraphScene(Scene):def slope_of_tangent(self, *args, **kwargs):"""- Returns the slople of the tangent to the plotted curve+ Returns the slople of the tangent to the plotted curveat a particular x-value.Parameters----------- x (Union[int, float])+ x : int, floatThe x value at which the tangent must touch the curve.-- graph ParametricFunction++ graph : ParametricFunctionThe ParametricFunction for which to calculate the tangent.-- dx (Union(float, int =0.01))++ dx : int, float, optionalThe small change in x with which a small change in ywill be compared in order to obtain the tangent.-+Returns-------float@@ -330,19 +330,19 @@ class GraphScene(Scene):Parameters----------- graph (ParametricFunction)+ graph : ParametricFunctionThe graph for which the derivative must be found.-- dx (Union(float, int =0.01))++ dx : float, int, optionalThe small change in x with which a small change in ywill be compared in order to obtain the derivative.-+**kwargsAny valid keyword argument of ParametricFunction-+Returns-------- ParametricFuncion+ ParametricFunctionThe curve of the derivative."""if "color" not in kwargs:@@ -370,22 +370,22 @@ class GraphScene(Scene):graph : ParametricFunctionThe curve of the function plotted.- label : str = "f(x)"+ label : str, optionalThe label for the function's curve.- x_val : Union[float, int]+ x_val : int, float, optionalThe x_value with which the label should be aligned.- direction : Union[np.ndarray,list,tuple]=RIGHT- The position, relative to the curve that the label will be at.+ direction : np.ndarray, list, tuple+ The cartesian position, relative to the curve that the label will be at.e.g LEFT, RIGHT- buff : Union[float, int]+ buff : float, int, optionThe buffer space between the curve and the label- color : str+ color : str, optionalThe color of the label.-+Returns-------TexMobject@@ -431,49 +431,49 @@ class GraphScene(Scene):Parameters----------- graph (ParametricFunction)+ graph : ParametricFunctionThe graph whose area needs to be approximatedby the Riemann Rectangles.-- x_min Union[int,float]++ x_min : int, float, optionalThe lower bound from which to start adding rectangles-- x_max Union[int,float]++ x_max : int, float, optionalThe upper bound where the rectangles stop.-- dx Union[int,float]- The smallest change in x-values that is++ dx : int, float, optional+ The smallest change in x-values that isconsidered significant.-- input_sample_type str++ input_sample_type : {"left", "right", "center"}Can be any of "left", "right" or "center-- stroke_width : Union[int, float]++ stroke_width : int, float, optionalThe stroke_width of the border of the rectangles.-- stroke_color : str++ stroke_color : str, optionalThe string of hex colour of the rectangle's border.- fill_opacity Union[int, float]- The opacity of the rectangles.+ fill_opacity : int, float+ The opacity of the rectangles. Takes values from 0 to 1.- start_color : str,+ start_color : str, optionalThe hex starting colour for the rectangles,this will, if end_color is a different colour,make a nice gradient.-- end_color : str,++ end_color : str, optionalThe hex ending colour for the rectangles,this will, if start_color is a different colour,make a nice gradient.-- show_signed_area : bool (True)++ show_signed_area : bool, optionalWhether or not to indicate -ve area if curve dips belowx-axis.-- width_scale_factor : Union[int, float]++ width_scale_factor : int, float, optionalHow much the width of the rectangles are scaled by when transforming.-+Returns-------VGroup@@ -533,24 +533,25 @@ class GraphScene(Scene):Parameters----------- graph (ParametricFunction)+ graph : ParametricFunctionThe graph whose area needs to be approximatedby the Riemann Rectangles.-- n_iterations,++ n_iterations : int,The number of VGroups of successive accuracy that are needed.-- max_dx Union[int,float]++ max_dx : int, float, optionalThe maximum change in x between two VGroups of Riemann Rectangles-- power_base Union[int,float=2]-- stroke_width : Union[int, float]++ power_base : int, float, optional+ Defaults to 2++ stroke_width : int, float, optionalThe stroke_width of the border of the rectangles.-+**kwargsAny valid keyword arguments of get_riemann_rectangles.-+Returns-------list@@ -571,18 +572,18 @@ class GraphScene(Scene):Returns a VGroup of Riemann rectanglessufficiently small enough to visuallyapproximate the area under the graph passed.-+Parameters----------- graph (ParametricFunction)+ graph : ParametricFunctionThe graph/curve for which the area needs to be gotten.-- t_min Union[int, float]++ t_min : int, floatThe lower bound of x from which to approximate the area.-- t_max Union[int, float]++ t_max : int, floatThe upper bound of x until which the area must be approximated.-+Returns-------VGroup@@ -608,10 +609,10 @@ class GraphScene(Scene):----------curr_rects : VGroupThe current Riemann Rectangles-+new_rects : VGroupThe Riemann Rectangles to transform to.-+**kwargsadded_animsAny other animations to play simultaneously.@@ -642,25 +643,25 @@ class GraphScene(Scene):**line_kwargs):"""- This method returns a Vertical line from the x-axis to+ This method returns a Vertical line from the x-axis tothe corresponding point on the graph/curve.Parameters----------- x Union[int,float]+ x : int, floatThe x-value at which the line should be placed/calculated.- graph (ParametricFunction)+ graph : ParametricFunctionThe graph on which the line should extend to.-- line_class (Line and similar)++ line_class : Line and similarThe type of line that should be used.- Defaults to Line-+ Defaults to Line.+**line_kwargsAny valid keyword arguments of the object passed in "line_class"If line_class is Line, any valid keyword arguments of Line are allowed.-+Return------An object of type passed in "line_class"@@ -683,27 +684,27 @@ class GraphScene(Scene):):"""Obtains multiple lines from the x axis to the Graph/curve.-+Parameters----------- graph (ParametricFunction)+ graph : ParametricFunctionThe graph on which the line should extend to.-- x_min (Union[int, float])++ x_min : int, float, optionalThe lower bound from which lines can appear.-- x_max (Union[int, float])++ x_max : int, float, optionalThe upper bound until which the lines can appear.-- num_lines (Union[int, float])++ num_lines : int, optionalThe number of lines (evenly spaced)that are needed.-+Returns-------VGroupThe VGroup of the evenly spaced lines.-+"""x_min = x_min or self.x_minx_max = x_max or self.x_max@@ -725,46 +726,46 @@ class GraphScene(Scene):secant_line_length=10,):"""- This method returns a VGroup of (two lines- representing dx and df, the labels for dx and- df, and the Secant to the Graph/curve at a+ This method returns a VGroup of (two lines+ representing dx and df, the labels for dx and+ df, and the Secant to the Graph/curve at aparticular x value.Parameters----------- x (Union[float, int])+ x : int, floatThe x value at which the secant enters, and intersectsthe graph for the first time.-- graph (ParametricFunction)++ graph : ParametricFunctionThe curve/graph for which the secant mustbe found.-- dx (Union[float, int])++ dx : int, float, optionalThe change in x after which the secant exits.-- dx_line_color (str)++ dx_line_color : str, optionalThe line color for the line that indicates the change in x.-- df_line_color (str)++ df_line_color : str, optionalThe line color for the line that indicates the change in y.-- dx_label (str)++ dx_label : str, optionalThe label to be provided for the change in x.-- df_label (str)++ df_label : str, optionalThe label to be provided for the change in y.-- include_secant_line (bool=True)++ include_secant_line : bool, optionalWhether or not to include the secant line in the graph,or just have the df and dx lines and labels.-- secant_line_color (str)++ secant_line_color : str, optionalThe color of the secant line.-- secant_line_length (Union[float,int=10])++ secant_line_length : int, float, optionalHow long the secant line should be.-+Returns:--------VGroup@@ -854,21 +855,21 @@ class GraphScene(Scene):Parameters----------- x_val (Union[float, int])+ x_val : float, intThe x value at which the secant enters, and intersectsthe graph for the first time.-- side (np.ndarray())-- label (str)++ side np.array(), optional++ label : str, optionalThe label to give the vertline and triangle-- color (str)++ color : str, optionalThe hex color of the label.-- animated (bool=False)++ animated : bool, optionalWhether or not to animate the addition of the T_label-+**kwargsAny valid keyword argument of a self.play call."""@@ -919,25 +920,25 @@ class GraphScene(Scene):self.left_v_line and self.right_v_line must be defined from self.get_v_lineself.left_T_label_group and self.right_T_label_group must be defined from self.add_T_label- This method will returna VGroup of new mobjects for each of those, when provided the graph/curve,+ This method will return a VGroup of new mobjects for each of those, when provided the graph/curve,the new t_min and t_max, the run_time and a bool stating whether or not to fade when close tothe origin.Parameters----------- graph (ParametricFunction)+ graph : ParametricFunctionThe graph for which this must be done.-- new_t_min (Union[int,float])++ new_t_min : int, floatThe new lower bound.-- new_t_max (Union[int,float])++ new_t_max : int, floatThe new upper bound.-- fade_close_to_origin (bool=True)++ fade_close_to_origin : bool, optionalWhether or not to fade when close to the origin.-- run_time (Union[int,float=1.0])++ run_time : int, float, optionalThe run_time of the animation of this change."""curr_t_min = self.x_axis.point_to_number(self.area.get_left())@@ -999,21 +1000,21 @@ class GraphScene(Scene):Parameters----------- secant_slope_group (VGroup)+ secant_slope_group : VGroupThe old secant_slope_group-- target_dx Union[int, float]++ target_dx : int, float, optionalThe new dx value.-- target_x Union[int, float]++ target_x : int, float, optionalThe new x value at which the secant should be.-- run_time Union[int,float=3]++ run_time : int, float, optionalThe run time for this change when animated.-- added_anims++ added_anims : list, optionalAny exta animations that should be played alongside.-+**anim_kwargsAny valid kwargs of a self.play call.diff --git a/manimlib/scene/moving_camera_scene.py b/manimlib/scene/moving_camera_scene.pyindex 3d419e198..5941ee85b 100644--- a/manimlib/scene/moving_camera_scene.py+++ b/manimlib/scene/moving_camera_scene.py@@ -31,8 +31,8 @@ class MovingCameraScene(Scene):Parameters----------- *animations (Animation)- The animations whose mobjects will be checked.+ *animations : Animation+ The Animations whose mobjects will be checked."""moving_mobjects = Scene.get_moving_mobjects(self, *animations)all_moving_mobjects = self.camera.extract_mobject_family_members(diff --git a/manimlib/scene/scene.py b/manimlib/scene/scene.pyindex dc4f1d1eb..69ba27a04 100644--- a/manimlib/scene/scene.py+++ b/manimlib/scene/scene.py@@ -23,9 +23,9 @@ class Scene(Container):other named scenes.Use a construct() function to tell Manim what should go on in the Scene.-+E.G:-+class MyScene(Scene):def construct(self):self.play(@@ -130,12 +130,12 @@ class Scene(Container):def get_attrs(self, *keys):"""Gets attributes of a scene given the attribute's identifier/name.-+Parameters----------- *args: (str)+ *keys : strName(s) of the argument(s) to return the attribute of.-+Returns-------list@@ -147,28 +147,30 @@ class Scene(Container):def set_camera(self, camera):"""Sets the scene's camera to be the passed Camera Object.+Parameters----------- camera: Union[Camera, MappingCamera,MovingCamera,MultiCamera,ThreeDCamera]- Camera object to use.+ camera : Camera+ The camera object to use."""self.camera = cameradef get_frame(self):"""- Gets current frame as NumPy array.-+ Gets the current frame as NumPy array.+Returns-------np.array- NumPy array of pixel values of each pixel in screen+ NumPy array of pixel values of each pixel in screen.+ The shape of the array is height x width x 3"""return np.array(self.camera.get_pixel_array())def get_image(self):"""Gets current frame as PIL Image-+Returns-------PIL.Image@@ -192,7 +194,7 @@ class Scene(Container):"""Sets the camera to display a Pixel Arrayin the background.-+Parameters----------background: Union[np.ndarray,list,tuple]@@ -222,15 +224,15 @@ class Scene(Container):"""Parameters:------------ mobjects: list+ mobjects: list, optionallist of mobjects-- background: np.ndarray- Pixel Array for Background-- include_submobjects: bool (True)-- ignore_skipping : bool (True)++ background: np.ndarray, optional+ Pixel Array for Background.++ include_submobjects: bool, optional++ ignore_skipping : bool, optional**kwargs@@ -259,10 +261,10 @@ class Scene(Container):def update_mobjects(self, dt):"""Begins updating all mobjects in the Scene.-+Parameters----------- dt: Union[int,float]+ dt: int or floatChange in time between updates. Defaults (mostly) to 1/frames_per_second"""for mobject in self.mobjects:@@ -272,7 +274,7 @@ class Scene(Container):"""Returns True if any mobject in Scene is being updatedor if the scene has always_update_mobjects set to true.-+Returns-------bool@@ -287,10 +289,10 @@ class Scene(Container):def get_time(self):"""Returns time in seconds elapsed after initialisation of scene-+Returns-------- self.time : Union[int,float]+ self.time : floatReturns time in seconds elapsed after initialisation of scene"""return self.time@@ -299,10 +301,10 @@ class Scene(Container):"""Increments the time elapsed after intialisation of scene bypassed "d_time".-+Parameters----------- d_time : Union[int,float]+ d_time : int or floatTime in seconds to increment by."""self.time += d_time@@ -352,9 +354,9 @@ class Scene(Container):Parameters---------- *mobjects+ *mobjects : MobjectMobjects to add.-+Returns-------Scene@@ -383,6 +385,11 @@ class Scene(Container):Removes mobjects in the passed list of mobjectsfrom the scene and the foreground, by removing themfrom "mobjects" and "foreground_mobjects"++ Parameters+ ----------+ *mobjects : Mobject+ The mobjects to remove."""for list_name in "mobjects", "foreground_mobjects":self.restructure_mobjects(mobjects, list_name, False)@@ -394,9 +401,9 @@ class Scene(Container):"""tl:wrIf your scene has a Group(), and you removed a mobject from the Group,- this dissolves the group and puts the rest of the mobjects directly+ this dissolves the group and puts the rest of the mobjects directlyin self.mobjects or self.foreground_mobjects.-+In cases where the scene contains a group, e.g. Group(m1, m2, m3), but oneof its submobjects is removed, e.g. scene.remove(m1), the list of mobjectswill be edited to contain other submobjects, but not m1, e.g. it will now@@ -406,13 +413,13 @@ class Scene(Container):----------to_remove : MobjectThe Mobject to remove.-- mobject_list_name : str++ mobject_list_name : str, optionalThe list of mobjects ("mobjects", "foreground_mobjects" etc) to remove from.-- extract_families : bool++ extract_families : bool, optionalWhether the mobject's families should be recursively extracted.-+Returns-------Scene@@ -429,22 +436,22 @@ class Scene(Container):"""Given a list of mobjects and a list of mobjects to be removed, thisfilters out the removable mobjects from the list of mobjects.-+Parameters----------mobjects : listThe Mobjects to check.-+to_remove : listThe list of mobjects to remove.-+Returns-------listThe list of mobjects with the mobjects to remove removed."""-+new_mobjects = []def add_safe_mobjects_from_list(list_to_examine, set_to_remove):@@ -462,14 +469,14 @@ class Scene(Container):# TODO, remove this, and calls to thisdef add_foreground_mobjects(self, *mobjects):"""- Adds mobjects to the foreground, and internally to the list+ Adds mobjects to the foreground, and internally to the listforeground_mobjects, and mobjects.Parameters----------*mobjects : MobjectThe Mobjects to add to the foreground.-+Returns------Scene@@ -484,14 +491,14 @@ class Scene(Container):def add_foreground_mobject(self, mobject):"""- Adds a single mobject to the foreground, and internally to the list+ Adds a single mobject to the foreground, and internally to the listforeground_mobjects, and mobjects.Parameters----------mobject : MobjectThe Mobject to add to the foreground.-+Returns------Scene@@ -501,14 +508,14 @@ class Scene(Container):def remove_foreground_mobjects(self, *to_remove):"""- Removes mobjects from the foreground, and internally from the list+ Removes mobjects from the foreground, and internally from the listforeground_mobjects.Parameters----------*to_remove : MobjectThe mobject(s) to remove from the foreground.-+Returns------Scene@@ -519,14 +526,14 @@ class Scene(Container):def remove_foreground_mobject(self, mobject):"""- Removes a single mobject from the foreground, and internally from the list+ Removes a single mobject from the foreground, and internally from the listforeground_mobjects.Parameters----------mobject : MobjectThe mobject to remove from the foreground.-+Returns------Scene@@ -536,14 +543,14 @@ class Scene(Container):def bring_to_front(self, *mobjects):"""- Adds the passed mobjects to the scene again,+ Adds the passed mobjects to the scene again,pushing them to he front of the scene.Parameters----------*mobjects : MobjectThe mobject(s) to bring to the front of the scene.-+Returns------Scene@@ -562,7 +569,7 @@ class Scene(Container):----------*mobjects : MobjectThe mobject(s) to push to the back of the scene.-+Returns------Scene@@ -581,7 +588,7 @@ class Scene(Container):Returns------Scene- The Scene, with all of its mobjects in+ The Scene, with all of its mobjects inself.mobjects and self.foreground_mobjectsremoved."""@@ -616,10 +623,10 @@ class Scene(Container):def get_moving_mobjects(self, *animations):"""Gets all moving mobjects in the passed animation(s).-+Parameters----------- *animations+ *animations : AnimationThe animations to check for moving mobjects.Returns@@ -650,20 +657,20 @@ class Scene(Container):This method is for Manim's internal use.Returns a CommandLine ProgressBar whose fill_time- is dependent on the run_time of an animation,+ is dependent on the run_time of an animation,the iterations to perform in that animationand a bool saying whether or not to considerthe skipped animations.Parameters----------- run_time: Union[int,float]+ run_time: floatThe run_time of the animation.-- n_iterations: None, int++ n_iterations: int, optionalThe number of iterations in the animation.-- override_skip_animations: bool (True)++ override_skip_animations: bool, optionalWhether or not to show skipped animations in the progress bar.Returns@@ -689,10 +696,10 @@ class Scene(Container):Parameters----------- animations: list- A list of the animations whose total+ animations: list of Animation+ A list of the animations whose totalrun_time is to be calculated.-+Returns------float@@ -708,11 +715,11 @@ class Scene(Container):Uses get_time_progression to obtainaCommandLine ProgressBar whose fill_time is- dependent on the qualities of the passed animation,+ dependent on the qualities of the passed Animation,Parameters----------- animations : list+ animations : list of AnimationThe list of animations to getthe time progression for.@@ -740,10 +747,11 @@ class Scene(Container):s hit, a MoveToTarget animation is built using the args thatfollow up until either another animation is hit, another methodis hit, or the args list runs out.-+Parameters----------- *args : Union[Animation, method(of a mobject, which is followed by that method's arguments)]+ *args : Animation or method of a mobject, which is followed by that method's arguments+**kwargs : any named arguments like run_time or lag_ratio.Returns@@ -811,10 +819,10 @@ class Scene(Container):This method is used internally to check if the currentanimation needs to be skipped or not. It also checks ifthe number of animations that were played correspond to- the number of animations that need to be played, and+ the number of animations that need to be played, andraises an EndSceneEarlyException if they don't correspond."""-+if self.start_at_animation_number:if self.num_plays == self.start_at_animation_number:self.skip_animations = False@@ -828,18 +836,18 @@ class Scene(Container):This method is used internally to wrap thepassed function, into a function thatactually writes to the video stream.- Simultaneously, it also adds to the number+ Simultaneously, it also adds to the numberof animations played.Parameters----------- func: function object+ func : functionThe play() like function that has to bewritten to the video file stream.Returns-------- function object+ functionThe play() like function that can now writeto the video file stream."""@@ -860,7 +868,7 @@ class Scene(Container):Parameters----------- animations: list+ animations : listList of involved animations."""@@ -882,7 +890,7 @@ class Scene(Container):Parameters----------- animations: list+ animations : listList of involved animations."""# Paint all non-moving objects onto the screen, so they don't@@ -909,7 +917,7 @@ class Scene(Container):Parameters----------- animations: list+ animations : listlist of animations to finish."""for animation in animations:@@ -933,8 +941,8 @@ class Scene(Container):Parameters----------- *args: Animation, mobject with mobject method and params- **kwargs: named parameters affecting what was passed in *args e.g run_time, lag_ratio etc.+ *args : Animation or mobject with mobject method and params+ **kwargs : named parameters affecting what was passed in *args e.g run_time, lag_ratio etc."""if len(args) == 0:warnings.warn("Called Scene.play with no animations")@@ -948,9 +956,9 @@ class Scene(Container):def idle_stream(self):"""- This method is used internally to- idle the vide file_writer until an- animation etc needs to be written+ This method is used internally to+ idle the video file_writer until an+ animation etc needs to be writtento the video file."""self.file_writer.idle_stream()@@ -962,7 +970,7 @@ class Scene(Container):Parameters----------- *animations: Animation+ *animations : AnimationAnimation to clean up.Returns@@ -999,12 +1007,12 @@ class Scene(Container):Parameters----------- duration: Union[list,float]+ duration: int or floatduration of wait time-- stop_condition: function++ stop_condition : functionThe function which determines whether to continue waiting.-+Returns-------ProgressBar@@ -1036,11 +1044,11 @@ class Scene(Container):Parameters----------- duration : Union[float, int]- The duration of wait time. Defaults to None.- stop_condition :+ duration : float or int, optional+ The duration of wait time.+ stop_condition :A function that determines whether to stop waiting or not.-+Returns-------Scene@@ -1077,15 +1085,14 @@ class Scene(Container):Like a wrapper for wait().You pass a function that determines whether to continue waiting,and a max wait time if that is never fulfilled.-+Parameters----------- stop_condition: function definition+ stop_condition : functionThe function whose boolean return value determines whether to continue waiting-- max_time: Union[int,float]++ max_time : int or float, optionalThe maximum wait time in seconds, if the stop_condition is never fulfilled.- Defaults to 60."""self.wait(max_time, stop_condition=stop_condition)@@ -1108,7 +1115,7 @@ class Scene(Container):def revert_to_original_skipping_status(self):"""Forces the scene to go back to its original skipping status,- by setting skip_animations to whatever it reads+ by setting skip_animations to whatever it readsfrom original_skipping_status.Returns@@ -1142,15 +1149,14 @@ class Scene(Container):Parameters----------- sound_file: str+ sound_file : strThe path to the sound file.-- time_offset: int,float = 0++ time_offset : int,float, optionalThe offset in the sound file after whichthe sound can be played.- gain:-- **kwargs : Present for excess?++ gain :"""if self.skip_animations:diff --git a/manimlib/scene/scene_file_writer.py b/manimlib/scene/scene_file_writer.pyindex 298339748..2b0182b7e 100644--- a/manimlib/scene/scene_file_writer.py+++ b/manimlib/scene/scene_file_writer.py@@ -238,12 +238,14 @@ class SceneFileWriter(object):Parameters----------- new_segment (AudioSegment)+ new_segment : AudioSegmentThe audio segment to add- time (Union[int, float])++ time : int, float, optionalthe timestamp at which thesound should be added.- gain_to_background++ gain_to_background : optionalThe gain of the segment from the background."""if not self.includes_sound:@@ -275,13 +277,13 @@ class SceneFileWriter(object):Parameters----------- sound_file (str)+ sound_file : strThe path to the sound file.- time (Union[float, int])+ time : float or int, optionalThe timestamp at which the audio should be added.- gain+ gain : optionalThe gain of the given audio segment.**kwargs@@ -303,7 +305,7 @@ class SceneFileWriter(object):Parameters----------- allow_write (bool=False)+ allow_write : bool, optionalWhether or not to write to a video file."""if self.write_to_movie and allow_write:@@ -316,7 +318,7 @@ class SceneFileWriter(object):Parameters----------- allow_write (bool=False)+ allow_write : bool, optionalWhether or not to write to a video file."""if self.write_to_movie and allow_write:@@ -329,7 +331,7 @@ class SceneFileWriter(object):Parameters----------- frame (np.ndarray)+ frame : np.arrayPixel array of the frame."""if self.write_to_movie:@@ -342,7 +344,7 @@ class SceneFileWriter(object):Parameters----------- image (np.ndarray)+ image : np.arrayThe pixel array of the image to save."""file_path = self.get_image_file_path()diff --git a/manimlib/scene/three_d_scene.py b/manimlib/scene/three_d_scene.pyindex 74d67a72a..672846267 100644--- a/manimlib/scene/three_d_scene.py+++ b/manimlib/scene/three_d_scene.py@@ -32,16 +32,16 @@ class ThreeDScene(Scene):Parameters----------- phi : (int,float)+ phi : int or float, optionalThe polar angle i.e the angle between Z_AXIS and Camera through ORIGIN in radians.-- theta : (int,float)++ theta : int or float, optionalThe azimuthal angle i.e the angle that spins the camera around the Z_AXIS.-- distance : (int, float)++ distance : int or float, optionalThe radial distance between ORIGIN and Camera.-- gamma : (int, float)++ gamma : int or float, optionalThe rotation of the camera about the vector from the ORIGIN to the Camera."""if phi is not None:@@ -60,7 +60,7 @@ class ThreeDScene(Scene):Parameters----------- rate : (int,float=0.02)+ rate : int or float, optionalThe rate at which the camera should rotate about the Z_AXIS.Negative rate means clockwise rotation."""@@ -92,24 +92,24 @@ class ThreeDScene(Scene):Parameters----------- phi : (int,float)+ phi : int or float, optionalThe polar angle i.e the angle between Z_AXIS and Camera through ORIGIN in radians.-- theta : (int,float)++ theta : int or float, optionalThe azimuthal angle i.e the angle that spins the camera around the Z_AXIS.-- distance : (int, float)++ distance : int or float, optionalThe radial distance between ORIGIN and Camera.-- gamma : (int, float)++ gamma : int or float, optionalThe rotation of the camera about the vector from the ORIGIN to the Camera.-- frame_center : Union[list,tuple,array]- The new center of the camera frame.- added_anims : list- Any other animations to be played at the same time?-+ frame_center : list, tuple or np.array, optional+ The new center of the camera frame in cartesian coordinates++ added_anims : list, optional+ Any other animations to be played at the same time.+"""anims = []value_tracker_pairs = [@@ -138,7 +138,7 @@ class ThreeDScene(Scene):Parameters----------- *animations (Animation)+ *animations : AnimationThe animations whose mobjects will be checked."""moving_mobjects = Scene.get_moving_mobjects(self, *animations)@@ -151,19 +151,19 @@ class ThreeDScene(Scene):"""This method is used to prevent the rotation and tiltingof mobjects as the camera moves around. The mobject can- still move in the x,y,z directions, but will always be- at the angle (relative to the camera) that it was at+ still move in the x,y,z directions, but will always be+ at the angle (relative to the camera) that it was atwhen it was passed through this method.)Parameters----------- *mobjects (Mobjects)- The Mobjects whose orientation must be fixed.-+ *mobjects : Mobject+ The Mobject(s) whose orientation must be fixed.+**kwargs- Some valid kwargs are- use_static_center_func (bool)- center_func (function)+ Some valid kwargs are+ use_static_center_func : bool+ center_func : function"""self.add(*mobjects)self.camera.add_fixed_orientation_mobjects(*mobjects, **kwargs)@@ -177,7 +177,7 @@ class ThreeDScene(Scene):Parameters----------- *mobjects (Mobjects)+ *mobjects : MobjectsThe Mobjects whose orientation must be fixed."""self.add(*mobjects)@@ -192,7 +192,7 @@ class ThreeDScene(Scene):Parameters----------- *mobjects (Mobjects)+ *mobjects : MobjectsThe Mobjects whose orientation must be unfixed."""self.camera.remove_fixed_orientation_mobjects(*mobjects)@@ -205,7 +205,7 @@ class ThreeDScene(Scene):Parameters----------- *mobjects (Mobjects)+ *mobjects : MobjectsThe Mobjects whose position and orientation must be unfixed."""self.camera.remove_fixed_in_frame_mobjects(*mobjects)@@ -219,7 +219,7 @@ class ThreeDScene(Scene):Parameters----------**kwargs- Some recognised kwargs are phi, theta, distance, gamma,+ Some recognised kwargs are phi, theta, distance, gamma,which have the same meaning as the parameters in set_camera_orientation."""config = dict(self.default_camera_orientation_kwargs)@@ -291,7 +291,7 @@ class SpecialThreeDScene(ThreeDScene):Returns-------- ThreeDAxes object+ ThreeDAxes"""axes = ThreeDAxes(**self.three_d_axes_config)for axis in axes:@@ -323,7 +323,7 @@ class SpecialThreeDScene(ThreeDScene):**kwargsSome valid kwargs are:Any param of a Sphere or ParametricSurface.-+Returns-------Spherediff --git a/manimlib/scene/vector_space_scene.py b/manimlib/scene/vector_space_scene.pyindex 825cf758d..1e6b04ddb 100644--- a/manimlib/scene/vector_space_scene.py+++ b/manimlib/scene/vector_space_scene.py@@ -52,11 +52,11 @@ class VectorScene(Scene):Parameters----------- animate : (bool=False)+ animate : bool, optionalWhether or not to animate the addition of the plane via ShowCreation.**kwargsAny valid keyword arguments accepted by NumberPlane.-+Returns-------NumberPlane@@ -74,9 +74,9 @@ class VectorScene(Scene):Parameters----------- animate (bool=False)+ animate : bool, optionalWhether or not to animate the addition of the axes through ShowCreation.- color (str)+ color : bool, optionalThe color of the axes. Defaults to WHITE."""axes = Axes(color=color, tick_frequency=1)@@ -89,13 +89,13 @@ class VectorScene(Scene):"""This method freezes the NumberPlane and Axes that were alreadyin the background, and adds new, manipulatable ones to the foreground.-+Parameters----------- dimness (Union[int,float=0.7])+ dimness : int, float, optionalThe required dimness of the NumberPlane-- axes_dimness (Union[int,float=0.5])++ axes_dimness : int, float, optionalThe required dimness of the Axes."""plane = self.add_plane()@@ -109,14 +109,14 @@ class VectorScene(Scene):def get_vector(self, numerical_vector, **kwargs):"""Returns an arrow on the Plane given an input numerical vector.-+Parameters----------- numerical_vector : Union(np.ndarray, list, tuple)+ numerical_vector : np.array, list, tupleThe Vector to plot.**kwargsAny valid keyword argument of Arrow.-+Returns-------Arrow@@ -135,24 +135,24 @@ class VectorScene(Scene):Parameters----------- vector Union(Arrow,list,tuple,np.ndarray)+ vector : Arrow, list, tuple, np.arrayIt can be a pre-made graphical vector, or thecoordinates of one.-- color (str)++ color : strThe string of the hex color of the vector.This is only taken into consideration if'vector' is not an Arrow. Defaults to YELLOW.-- animate (bool=True)++ animate : boolWhether or not to animate the addition of the vectorby using GrowArrow-+**kwargsAny valid keyword argument of Arrow.These are only considered if vector is notan Arrow.-+Returns-------Arrow@@ -172,12 +172,12 @@ class VectorScene(Scene):Parameters----------- vector (Arrow)+ vector : ArrowThe arrow representing the vector.-+**kwargsAny valid keyword arguments of matrix.vector_coordinate_label-+integer_labels (True) : Whether or not to round the coordinatesto integers.n_dim (2) : The number of dimensions of the vector.@@ -198,12 +198,12 @@ class VectorScene(Scene):Parameters----------- i_hat_color (str)+ i_hat_color : strThe hex colour to use for the basis vector in the x direction-- j_hat_color (str)++ j_hat_color : strThe hex colour to use for the basis vector in the y direction-+Returns-------VGroup@@ -261,19 +261,21 @@ class VectorScene(Scene):Parameters----------- vector+ vector : VectorVector Object for which to get the label.- at_tip (bool)++ at_tip : boolWhether or not to place the label at the tip of the vector.- direction (str="left")++ direction : {"left"}If the label should be on the "left" or right of the vector.- rotate (bool=False)+ rotate : boolWhether or not to rotate it to align it with the vector.- color (str)+ color : strThe color to give the label.label_scale_factor (Union[int,float])How much to scale the label by.-+Returns-------TexMobject@@ -312,15 +314,18 @@ class VectorScene(Scene):Parameters----------- vector (Vector)+ vector : VectorThe vector for which the label must be added.- label (TexMobject,str)++ label : TexMobject, strThe TexMobject/string of the label.- animate (bool=True)++ animate : bool, optionalWhether or not to animate the labelling w/ Write+**kwargsAny valid keyword argument of get_vector_label-+Returns-------TexMobject@@ -351,16 +356,16 @@ class VectorScene(Scene):Parameters----------- vector Union(np.ndarray, list, tuple)+ vector : np.ndarray, list, tupleThe vector to show.-- coords_start Union(np.ndarray,list,tuple)- The starting point of the location of- the label of the vector that shows it++ coords_start : np.ndarray,list,tuple, optional+ The starting point of the location of+ the label of the vector that shows itnumerically.Defaults to 2 * RIGHT + 2 * UP or (2,2)-- clean_up (bool=True)++ clean_up : bool, optionalWhether or not to remove whateverthis method did after it's done.@@ -399,21 +404,21 @@ class VectorScene(Scene):def vector_to_coords(self, vector, integer_labels=True, clean_up=True):"""- This method displays vector as a Vector() based vector, and then shows- the corresponding lines that make up the x and y components of the vector.- Then, a column matrix (henceforth called the label) is created near the+ This method displays vector as a Vector() based vector, and then shows+ the corresponding lines that make up the x and y components of the vector.+ Then, a column matrix (henceforth called the label) is created near thehead of the Vector.Parameters----------- vector Union(np.ndarray, list, tuple)+ vector : np.ndarray, list, tupleThe vector to show.-- integer_label (bool=True)++ integer_label : bool, optionalWhether or not to round the value displayed.in the vector's label to the nearest integer-- clean_up (bool=True)++ clean_up : bool, optionalWhether or not to remove whateverthis method did after it's done.@@ -470,13 +475,13 @@ class VectorScene(Scene):def show_ghost_movement(self, vector):"""This method plays an animation that partially shows the entire plane moving- in the direction of a particular vector. This is useful when you wish to+ in the direction of a particular vector. This is useful when you wish toconvey the idea of mentally moving the entire plane in a direction, withoutactually moving the plane.Parameters----------- vector (Union[Arrow, list, tuple, np.ndarray])+ vector : Arrow, list, tuple, np.ndarrayThe vector which indicates the direction of movement."""if isinstance(vector, Arrow):@@ -580,11 +585,11 @@ class LinearTransformationScene(VectorScene):Parameters----------- mob_list (list)+ mob_list : listThe special list to which you want to addthese mobjects.-- *mobs_to_add (Mobject)++ *mobs_to_add : MobjectThe mobjects to add."""@@ -600,7 +605,7 @@ class LinearTransformationScene(VectorScene):Parameters----------- *mobjects (Mobject)+ *mobjects : MobjectThe mobjects to add to the list."""self.add_special_mobjects(self.background_mobjects, *mobjects)@@ -613,7 +618,7 @@ class LinearTransformationScene(VectorScene):Parameters----------- *mobjects (Mobject)+ *mobjects : MobjectThe mobjects to add to the list"""self.add_special_mobjects(self.foreground_mobjects, *mobjects)@@ -625,7 +630,7 @@ class LinearTransformationScene(VectorScene):Parameters----------- *mobjects (Mobject)+ *mobjects : MobjectThe mobjects to add to the list."""self.add_special_mobjects(self.transformable_mobjects, *mobjects)@@ -640,10 +645,10 @@ class LinearTransformationScene(VectorScene):Parameters----------- mobject (Mobject)+ mobject : MobjectThe mobjects to add to the list-- target_mobject (Mobject)++ target_mobject : Mobject, optionalWhat the moving_mobject goes to, etc."""mobject.target = target_mobject@@ -652,6 +657,21 @@ class LinearTransformationScene(VectorScene):def get_unit_square(self, color=YELLOW, opacity=0.3, stroke_width=3):"""Returns a unit square for the current NumberPlane.++ Parameters+ ----------+ color : str, optional+ The string of the hex color code of the color wanted.++ opacity : float, int, optional+ The opacity of the square++ stroke_width : int, float, optional+ The stroke_width in pixels of the border of the square++ Returns+ -------+ Square"""square = self.square = Rectangle(color=color,@@ -678,7 +698,7 @@ class LinearTransformationScene(VectorScene):**kwargsAny valid keyword arguments ofself.get_unit_square()-+Returns-------Square@@ -702,18 +722,18 @@ class LinearTransformationScene(VectorScene):Parameters----------- vector Union(Arrow,list,tuple,np.ndarray)+ vector : Arrow,list,tuple,np.ndarrayIt can be a pre-made graphical vector, or thecoordinates of one.-- color (str)++ color : strThe string of the hex color of the vector.This is only taken into consideration if'vector' is not an Arrow. Defaults to YELLOW.-+**kwargsAny valid keyword argument of VectorScene.add_vector.-+Returns-------Arrow@@ -733,9 +753,9 @@ class LinearTransformationScene(VectorScene):Parameters----------- vector (Arrow)+ vector : ArrowThe arrow representing the vector.-+**kwargsAny valid keyword arguments of VectorScene.write_vector_coordinates@@ -759,12 +779,18 @@ class LinearTransformationScene(VectorScene):Parameters----------- vector (Vector)+ vector : VectorThe vector for which the label must be added.- label (TexMobject,str)++ label : TexMobject,strThe TexMobject/string of the label.- new_label (TexMobject,str,None)++ transformation_name : str, TexMobject, optional+ The name to give the transformation as a label.++ new_label : TexMobject,str, optionalWhat the label should display after a Linear Transformation+**kwargsAny valid keyword argument of get_vector_label@@ -796,15 +822,15 @@ class LinearTransformationScene(VectorScene):Parameters----------- title (str,TexMobject,TextMobject)+ title : str,TexMobject,TextMobjectWhat the title should be.-- scale_factor (int,float=1.5)++ scale_factor : int, float, optionalHow much the title should be scaled by.-- animate (bool=False)++ animate : boolWhether or not to animate the addition.-+Returns-------LinearTransformationScene@@ -827,7 +853,7 @@ class LinearTransformationScene(VectorScene):Parameters----------- matrix (np.ndarray, list, tuple)+ matrix : np.ndarray, list, tupleThe matrix."""return self.get_transposed_matrix_transformation(np.array(matrix).T)@@ -835,12 +861,12 @@ class LinearTransformationScene(VectorScene):def get_transposed_matrix_transformation(self, transposed_matrix):"""Returns a function corresponding to the linear- transformation represented by the transposed+ transformation represented by the transposedmatrix passed.Parameters----------- matrix (np.ndarray, list, tuple)+ matrix : np.ndarray, list, tupleThe matrix."""transposed_matrix = np.array(transposed_matrix)@@ -854,16 +880,16 @@ class LinearTransformationScene(VectorScene):def get_piece_movement(self, pieces):"""- This method returns an animation that moves an arbitrary+ This method returns an animation that moves an arbitrarymobject in "pieces" to its corresponding .target value.If self.leave_ghost_vectors is True, ghosts of the originalpositions/mobjects are left on screenParameters----------- pieces (Union[list, tuple, np.array])+ pieces : list, tuple, np.arrayThe pieces for which the movement must be shown.-+Returns-------Animation@@ -884,10 +910,10 @@ class LinearTransformationScene(VectorScene):Parameters----------- func (function)+ func : functionThe function that determines where the .target ofthe moving mobject goes.-+Returns-------Animation@@ -909,10 +935,10 @@ class LinearTransformationScene(VectorScene):Parameters----------- func (function)+ func : functionThe function that determines where the .target ofthe moving mobject goes.-+Returns-------Animation@@ -949,7 +975,7 @@ class LinearTransformationScene(VectorScene):Parameters----------- matrix (Union[np.ndarray, list, tuple])+ matrix : np.ndarray, list, tupleThe matrix.**kwargsAny valid keyword argument of self.apply_transposed_matrix()@@ -961,10 +987,10 @@ class LinearTransformationScene(VectorScene):This method applies the linear transformationrepresented by the inverse of the passed matrixto the number plane, and each vector/similar mobject on it.-+Parameters----------- matrix (Union[np.ndarray, list, tuple])+ matrix : np.ndarray, list, tupleThe matrix whose inverse is to be applied.**kwargsAny valid keyword argument of self.apply_matrix()@@ -979,7 +1005,7 @@ class LinearTransformationScene(VectorScene):Parameters----------- matrix (Union[np.ndarray, list, tuple])+ matrix : np.ndarray, list, tupleThe matrix.**kwargsAny valid keyword argument of self.apply_function()@@ -996,12 +1022,12 @@ class LinearTransformationScene(VectorScene):def apply_inverse_transpose(self, t_matrix, **kwargs):"""Applies the inverse of the transformation represented- by the given transposed matrix to the number plane and each+ by the given transposed matrix to the number plane and eachvector/similar mobject on it.Parameters----------- matrix (Union[np.ndarray, list, tuple])+ matrix : np.ndarray, list, tupleThe matrix.**kwargsAny valid keyword argument of self.apply_transposed_matrix()@@ -1017,7 +1043,7 @@ class LinearTransformationScene(VectorScene):Parameters----------- function (Function)+ function : FunctionThe function.**kwargsAny valid keyword argument of self.apply_function()@@ -1033,14 +1059,14 @@ class LinearTransformationScene(VectorScene):Parameters----------- function (Function)+ function : FunctionThe function that affects each pointof each mobject in self.transformable_mobjects.-- added_anims (list)++ added_anims : list, optionalAny other animations that need to be playedsimulataneously with this.-+**kwargsAny valid keyword argument of a self.play() call."""diff --git a/manimlib/scene/zoomed_scene.py b/manimlib/scene/zoomed_scene.pyindex 44ac52bad..2fde50860 100644--- a/manimlib/scene/zoomed_scene.py+++ b/manimlib/scene/zoomed_scene.py@@ -68,10 +68,10 @@ class ZoomedScene(MovingCameraScene):"""This method is used to activate the zooming forthe zoomed_camera.-+Parameters----------- animate (bool=False)+ animate : bool, optionalWhether or not to animate the activationof the zoomed camera."""@@ -88,14 +88,14 @@ class ZoomedScene(MovingCameraScene):def get_zoom_in_animation(self, run_time=2, **kwargs):"""Returns the animation of camera zooming in.-+Parameters----------- run_time (Union[int,float=2])+ run_time : int or float, optionalThe run_time of the animation of the camera zooming in.**kwargsAny valid keyword arguments of ApplyMethod()-+Returns-------ApplyMethod@@ -115,7 +115,7 @@ class ZoomedScene(MovingCameraScene):"""This is the animation of the popping out of themini-display that shows the content of the zoomed- camera.+ camera.Returns-------