Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

remove unnecessary files

leotrs482e7cd48680
diff --git a/perf_scenes.py b/perf_scenes.py
deleted file mode 100644
index 80d468e7b..000000000
--- a/perf_scenes.py
+++ /dev/null
@@ -1,88 +0,0 @@
-from manimlib.imports import *
-
-"""
-A set of scenes to be used for performance testing of Manim.
-"""
-
-
-class Perf1(GraphScene):
- """
- A simple scene of two animations from the end of a video on recursion.
-
- - Uses a graph in 1/4 of the scene.
- - First fades in multiple lines of text and equations, and the graph axes.
- - Next animates creation of two graphs and the creation of their text
- labels.
- """
- CONFIG = {
- "x_axis_label":
- "$n$",
- "y_axis_label":
- "$time$",
- "x_axis_width":
- FRAME_HEIGHT,
- "y_axis_height":
- FRAME_HEIGHT / 2,
- "y_max":
- 50,
- "y_min":
- 0,
- "x_max":
- 100,
- "x_min":
- 0,
- "x_labeled_nums": [50, 100],
- "y_labeled_nums":
- range(0, 51, 10),
- "y_tick_frequency":
- 10,
- "x_tick_frequency":
- 10,
- "axes_color":
- BLUE,
- "graph_origin":
- np.array(
- (-FRAME_X_RADIUS + LARGE_BUFF, -FRAME_Y_RADIUS + LARGE_BUFF, 0))
- }
-
- def construct(self):
- t1 = TextMobject(
- "Dividing a problem in half over and over means\\\\"
- "the work done is proportional to $\\log_2{n}$").to_edge(UP)
-
- t2 = TextMobject(
- '\\textit{This is one of our\\\\favorite things to do in CS!}')
- t2.to_edge(RIGHT)
-
- t3 = TextMobject(
- 'The new \\texttt{power(x,n)} is \\underline{much}\\\\better than the old!'
- )
- t3.scale(0.8)
- p1f = TexMobject('x^n=x \\times x^{n-1}').set_color(ORANGE)
- t4 = TextMobject('\\textit{vs.}').scale(0.8)
- p2f = TexMobject(
- 'x^n=x^{\\frac{n}{2}} \\times x^{\\frac{n}{2}}').set_color(GREEN)
- p1v2g = VGroup(t3, p1f, t4, p2f).arrange(DOWN).center().to_edge(RIGHT)
-
- self.setup_axes()
- o_n = self.get_graph(lambda x: x, color=ORANGE, x_min=1, x_max=50)
- o_log2n = self.get_graph(lambda x: math.log2(x),
- color=GREEN,
- x_min=2,
- x_max=90)
- onl = TexMobject('O(n)')
- olog2nl = TexMobject('O(\\log_2{n})')
- onl.next_to(o_n.get_point_from_function(0.6), UL)
- olog2nl.next_to(o_log2n.get_point_from_function(0.8), UP)
- self.play(
- FadeIn(t1),
- FadeIn(self.axes),
- # FadeInFromDown(t2),
- FadeIn(p1v2g),
- )
- self.play(ShowCreation(o_n),
- ShowCreation(o_log2n),
- ShowCreation(onl),
- ShowCreation(olog2nl),
- run_time=3)
- self.wait(duration=5)
diff --git a/stage_scenes.py b/stage_scenes.py
deleted file mode 100644
index 8ecf07f91..000000000
--- a/stage_scenes.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env python
-import inspect
-import os
-import sys
-import importlib
-
-import manimlib.constants as consts
-from manimlib.constants import PRODUCTION_QUALITY_CAMERA_CONFIG
-from manimlib.config import get_module
-from manimlib.extract_scene import is_child_scene
-
-
-def get_sorted_scene_classes(module_name):
- module = get_module(module_name)
- if hasattr(module, "SCENES_IN_ORDER"):
- return module.SCENES_IN_ORDER
- # Otherwise, deduce from the order in which
- # they're defined in a file
- importlib.import_module(module.__name__)
- line_to_scene = {}
- name_scene_list = inspect.getmembers(
- module,
- lambda obj: is_child_scene(obj, module)
- )
- for name, scene_class in name_scene_list:
- if inspect.getmodule(scene_class).__name__ != module.__name__:
- continue
- lines, line_no = inspect.getsourcelines(scene_class)
- line_to_scene[line_no] = scene_class
- return [
- line_to_scene[index]
- for index in sorted(line_to_scene.keys())
- ]
-
-
-def stage_scenes(module_name):
- scene_classes = get_sorted_scene_classes(module_name)
- if len(scene_classes) == 0:
- print("There are no rendered animations from this module")
- return
- # output_directory_kwargs = {
- # "camera_config": PRODUCTION_QUALITY_CAMERA_CONFIG,
- # }
- # TODO, fix this
- animation_dir = os.path.join(
- os.path.expanduser('~'),
- "Dropbox (3Blue1Brown)/3Blue1Brown Team Folder/videos",
- "bayes", "1440p60"
- )
- #
- files = os.listdir(animation_dir)
- sorted_files = []
- for scene_class in scene_classes:
- scene_name = scene_class.__name__
- clips = [f for f in files if f.startswith(scene_name + ".")]
- for clip in clips:
- sorted_files.append(os.path.join(animation_dir, clip))
- # Partial movie file directory
- # movie_dir = get_movie_output_directory(
- # scene_class, **output_directory_kwargs
- # )
- # if os.path.exists(movie_dir):
- # for extension in [".mov", ".mp4"]:
- # int_files = get_sorted_integer_files(
- # pmf_dir, extension=extension
- # )
- # for file in int_files:
- # sorted_files.append(os.path.join(pmf_dir, file))
- # else:
-
- # animation_subdir = os.path.dirname(animation_dir)
- count = 0
- while True:
- staged_scenes_dir = os.path.join(
- animation_dir,
- os.pardir,
- "staged_scenes_{}".format(count)
- )
- if not os.path.exists(staged_scenes_dir):
- os.makedirs(staged_scenes_dir)
- break
- # Otherwise, keep trying new names until
- # there is a free one
- count += 1
- for count, f in reversed(list(enumerate(sorted_files))):
- # Going in reversed order means that when finder
- # sorts by date modified, it shows up in the
- # correct order
- symlink_name = os.path.join(
- staged_scenes_dir,
- "Scene_{:03}_{}".format(
- count, f.split(os.sep)[-1]
- )
- )
- os.symlink(f, symlink_name)
-
-
-if __name__ == "__main__":
- if len(sys.argv) < 2:
- raise Exception("No module given.")
- module_name = sys.argv[1]
- stage_scenes(module_name)