Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Rename get_submobject_index_labels to index_labels (#865)

kilacoda713b96805a4a
diff --git a/manim/utils/debug.py b/manim/utils/debug.py
index 5ee34fce6..ba3cd02ea 100644
--- a/manim/utils/debug.py
+++ b/manim/utils/debug.py
@@ -1,10 +1,11 @@
"""Debugging utilities."""
-__all__ = ["print_family", "get_submobject_index_labels"]
+__all__ = ["print_family", "index_labels","get_submobject_index_labels"]
from .color import BLACK
from ..mobject.numbers import Integer
from ..mobject.types.vectorized_mobject import VGroup
+import logging
def print_family(mobject, n_tabs=0):
@@ -14,7 +15,7 @@ def print_family(mobject, n_tabs=0):
print_family(submob, n_tabs + 1)
-def get_submobject_index_labels(mobject, label_height=0.15):
+def index_labels(mobject, label_height=0.15):
labels = VGroup()
for n, submob in enumerate(mobject):
label = Integer(n)
@@ -23,3 +24,10 @@ def get_submobject_index_labels(mobject, label_height=0.15):
label.set_stroke(BLACK, 5, background=True)
labels.add(label)
return labels
+
+
+def get_submobject_index_labels(mobject, label_height=0.15):
+ logging.getLogger("manim").warning(
+ "get_submobject_index_labels has been deprecated and has been replaced by index_labels, which does the same thing, and will thus be removed in a future release."
+ )
+ return index_labels(mobject,label_height)
\ No newline at end of file