Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Removed the deprecated Small Dot (#1349)

kolibril13a2037bdee76e
diff --git a/manim/constants.py b/manim/constants.py
index 18c5aee29..c9daca46d 100644
--- a/manim/constants.py
+++ b/manim/constants.py
@@ -99,10 +99,10 @@ DR: np.ndarray = DOWN + RIGHT
# Geometry
START_X: int = 30
START_Y: int = 20
-DEFAULT_DOT_RADIUS = 0.08
-DEFAULT_SMALL_DOT_RADIUS = 0.04
-DEFAULT_DASH_LENGTH = 0.05
-DEFAULT_ARROW_TIP_LENGTH = 0.35
+DEFAULT_DOT_RADIUS: float = 0.08
+DEFAULT_SMALL_DOT_RADIUS: float = 0.04
+DEFAULT_DASH_LENGTH: float = 0.05
+DEFAULT_ARROW_TIP_LENGTH: float = 0.35
# Default buffers (padding)
SMALL_BUFF: float = 0.1
diff --git a/manim/mobject/geometry.py b/manim/mobject/geometry.py
index a0efc3753..7d65e4e5e 100644
--- a/manim/mobject/geometry.py
+++ b/manim/mobject/geometry.py
@@ -32,7 +32,6 @@ __all__ = [
"Dot",
"AnnotationDot",
"LabeledDot",
- "SmallDot",
"Ellipse",
"AnnularSector",
"Sector",
@@ -260,9 +259,9 @@ class Arc(TipableVMobject):
def __init__(
self,
+ radius: float = 1.0,
start_angle=0,
angle=TAU / 4,
- radius=1.0,
num_components=9,
anchors_span_full_range=True,
arc_center=ORIGIN,
@@ -421,10 +420,16 @@ class Circle(Arc):
"""
def __init__(
- self, color=RED, close_new_points=True, anchors_span_full_range=False, **kwargs
+ self,
+ radius: float = None,
+ color=RED,
+ close_new_points=True,
+ anchors_span_full_range=False,
+ **kwargs
):
Arc.__init__(
self,
+ radius=radius,
start_angle=0,
angle=TAU,
color=color,
@@ -550,7 +555,7 @@ class Dot(Circle):
def __init__(
self,
point=ORIGIN,
- radius=DEFAULT_DOT_RADIUS,
+ radius: float = DEFAULT_DOT_RADIUS,
stroke_width=0,
fill_opacity=1.0,
color=WHITE,
@@ -567,17 +572,6 @@ class Dot(Circle):
)
-class SmallDot(Dot):
- """Deprecated - A dot with small radius"""
-
- def __init__(self, radius=DEFAULT_SMALL_DOT_RADIUS, **kwargs):
- logger.warning(
- "SmallDot has been deprecated and will be removed in a future release. "
- "Use Dot instead."
- )
- Dot.__init__(self, radius=radius, **kwargs)
-
-
class AnnotationDot(Dot):
"""
A dot with bigger radius and bold stroke to annotate scenes.
@@ -585,7 +579,7 @@ class AnnotationDot(Dot):
def __init__(
self,
- radius=DEFAULT_DOT_RADIUS * 1.3,
+ radius: float = DEFAULT_DOT_RADIUS * 1.3,
stroke_width=5,
stroke_color=WHITE,
fill_color=BLUE,
diff --git a/tests/test_graphical_units/test_geometry.py b/tests/test_graphical_units/test_geometry.py
index a655e675a..8115169b4 100644
--- a/tests/test_graphical_units/test_geometry.py
+++ b/tests/test_graphical_units/test_geometry.py
@@ -14,7 +14,7 @@ class CoordinatesTest(Scene):
class ArcTest(Scene):
def construct(self):
- a = Arc(PI)
+ a = Arc(radius=1, start_angle=PI)
self.add(a)