Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

added set_test

Hugues Devimeux4f9b9bb4f498
diff --git a/manim/__init__.py b/manim/__init__.py
index eb741d49c..3dba5e7b4 100644
--- a/manim/__init__.py
+++ b/manim/__init__.py
@@ -69,3 +69,4 @@ from .utils.sounds import *
from .utils.space_ops import *
from .utils.strings import *
from .utils.tex import *
+from .utils.set_test import *
diff --git a/manim/utils/set_test.py b/manim/utils/set_test.py
new file mode 100644
index 000000000..4af85eb99
--- /dev/null
+++ b/manim/utils/set_test.py
@@ -0,0 +1,13 @@
+import numpy as np
+import os
+import inspect
+
+def set_test_scene(scene_object, CONFIG, module_name):
+ """Function used to set up the test data for a new feature. Please Refer to the wiki."""
+ scene = scene_object(**CONFIG)
+ data = scene.get_frame()
+ path = os.path.join("manim","tests","tests_data","{}".format(module_name))
+ if not os.path.isdir(path):
+ os.makedirs(path)
+ np.save(os.path.join(path, str(scene)), data)
+ print('Saved in ' + path + '\n')